Skip to content

Commit 9313b0a

Browse files
committed
add test for 'options.compilerOptions'
1 parent bd338ab commit 9313b0a

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

test/index.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const dir = join(__dirname, 'fixtures');
66
const tmp = join(__dirname, '.tmp');
77

88
test('fly-typescript', t => {
9-
t.plan(13);
9+
t.plan(16);
1010

1111
const fly = new Fly({
1212
plugins: [
@@ -56,11 +56,25 @@ test('fly-typescript', t => {
5656
t.ok(/System.register/.test(str), 'listen to `compilerOptions.module` option');
5757
t.ok(/App = class App/.test(str), 'listen to `compilerOptions.target` option');
5858
yield f.clear(tmp);
59+
},
60+
*f(f) {
61+
yield f.source(`${dir}/*.ts`).typescript({
62+
moduleName: 'FooBar',
63+
compilerOptions: {
64+
module: 'System',
65+
target: 'ES2015'
66+
}
67+
}).target(tmp);
68+
const str = yield f.$.read(`${tmp}/app.js`, 'utf8');
69+
t.ok(/FooBar/.test(str), 'listen to `moduleName` option');
70+
t.ok(/System.register/.test(str), 'listen to `compilerOptions.module` option');
71+
t.ok(/App = class App/.test(str), 'listen to `compilerOptions.target` option');
72+
yield f.clear(tmp);
5973
}
6074
}
6175
});
6276

6377
t.ok('typescript' in fly.plugins, 'add the `typescript` plugin');
6478

65-
fly.serial(['a', 'b', 'c', 'd', 'e']);
79+
fly.serial(['a', 'b', 'c', 'd', 'e', 'f']);
6680
});

0 commit comments

Comments
 (0)