Skip to content

Commit

Permalink
add test for 'options.compilerOptions'
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeed committed Apr 11, 2017
1 parent bd338ab commit 9313b0a
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const dir = join(__dirname, 'fixtures');
const tmp = join(__dirname, '.tmp');

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

const fly = new Fly({
plugins: [
Expand Down Expand Up @@ -56,11 +56,25 @@ test('fly-typescript', t => {
t.ok(/System.register/.test(str), 'listen to `compilerOptions.module` option');
t.ok(/App = class App/.test(str), 'listen to `compilerOptions.target` option');
yield f.clear(tmp);
},
*f(f) {
yield f.source(`${dir}/*.ts`).typescript({
moduleName: 'FooBar',
compilerOptions: {
module: 'System',
target: 'ES2015'
}
}).target(tmp);
const str = yield f.$.read(`${tmp}/app.js`, 'utf8');
t.ok(/FooBar/.test(str), 'listen to `moduleName` option');
t.ok(/System.register/.test(str), 'listen to `compilerOptions.module` option');
t.ok(/App = class App/.test(str), 'listen to `compilerOptions.target` option');
yield f.clear(tmp);
}
}
});

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

fly.serial(['a', 'b', 'c', 'd', 'e']);
fly.serial(['a', 'b', 'c', 'd', 'e', 'f']);
});

0 comments on commit 9313b0a

Please sign in to comment.