Skip to content
This repository has been archived by the owner on Apr 1, 2019. It is now read-only.

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
k88hudson committed Jan 12, 2016
1 parent 33fa9e6 commit 11af15a
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests-node/generate-locale-data.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"use strict";
const path = require("path");
const child = require("child_process");
const assert = require("chai").assert;

const filepath = path.join(__dirname, "../bin/generate-locale-data.js");

function execute(args) {
return child.execSync(`node ${filepath}`, {input: args, encoding: "utf8"});
}

describe("generateLocaleData", () => {
let result;
let window;
beforeEach(() => {
window = {};
result = execute();
eval(result);
});

it("should generate some js", () => {
assert.ok(result);
});

it("should add newTabLocaleInfo to window", () => {
assert.property(window, 'newTabLocaleInfo');
assert.property(window.newTabLocaleInfo, 'locale');
assert.property(window.newTabLocaleInfo, 'messages');
assert.isObject(window.newTabLocaleInfo.messages);
});

it("should add reactIntlData to window", () => {
assert.property(window, 'reactIntlLocaleData');
assert.isArray(window.reactIntlLocaleData);
});
});

0 comments on commit 11af15a

Please sign in to comment.