forked from BANG88/typescript-react-intl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
53 lines (42 loc) · 1.02 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/// <reference path="../node_modules/ava/types/generated.d.ts" />
var p = require("../lib").default;
var fs = require("fs");
function A() {
var content = fs.readFileSync(__dirname + "/app/index.tsx");
var res = p(content.toString());
var expected = [
{
id: "app",
defaultMessage: "the defualt message"
}
];
t.is(res.length, 1);
t.deepEqual(res, expected);
}
function B() {
var content = fs.readFileSync(__dirname + "/app/empty.tsx");
var res = p(content.toString());
var expected = [];
console.log(res);
}
function C() {
var content = fs.readFileSync(__dirname + "/app/defineMessages.ts");
var res = p(content.toString());
var expected = [
{
id: "intro.hello",
defaultMessage: "Hello world"
},
{
id: "app.title",
defaultMessage: "Hello"
}
];
}
function D() {
var content = fs.readFileSync(__dirname + "/app/statelessComponent.tsx");
var res = p(content.toString());
var expected = [{ id: "i.am.ok", defaultMessage: "yep" }];
}
// A()
D();