Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/cli/src/commands/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ export class TestCommand implements Command {
wctArgs.push('--npm');
}

if (config.moduleResolution) {
wctArgs.push(`--module-resolution=${config.moduleResolution}`);
}

if (config.componentDir) {
wctArgs.push(`--component-dir='${config.componentDir}'`);
}
Expand Down
8 changes: 2 additions & 6 deletions packages/cli/src/test/integration/integration_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ suite('integration tests', function() {
.toPromise();
await runCommand(binPath, ['install'], {cwd: dir});
await runCommand(binPath, ['lint'], {cwd: dir});
// TODO(#113): Remove the `--module-resolution=node` argument once
// `polymer test` passes them in correctly
await runCommand(binPath, ['test', '--module-resolution=node'], {cwd: dir});
await runCommand(binPath, ['test'], {cwd: dir});
});

skipOnWindows('test the Polymer 3.x application template', async () => {
Expand All @@ -53,9 +51,7 @@ suite('integration tests', function() {
.toPromise();
await runCommand(binPath, ['install'], {cwd: dir});
await runCommand(binPath, ['lint'], {cwd: dir});
// TODO(#113): Remove the `--module-resolution=node` argument once
// `polymer test` passes them in correctly
await runCommand(binPath, ['test', '--module-resolution=node'], {cwd: dir});
await runCommand(binPath, ['test'], {cwd: dir});
await runCommand(binPath, ['build'], {cwd: dir});
});

Expand Down
10 changes: 10 additions & 0 deletions packages/cli/src/test/unit/commands/test_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,14 @@ suite('test', () => {
assert.includeMembers(wctArgs, [`--component-dir='path/to/deps/'`]);
});

test('--module-resolution flag is passed to WCT', async () => {
const wctCliRunStub =
sandbox.stub(wct.cli, 'run').returns(Promise.resolve());
const cli = new PolymerCli(['test', '--module-resolution=node']);
await cli.run();

const wctArgs = wctCliRunStub.args[0][1];
assert.includeMembers(wctArgs, [`--module-resolution=node`]);
});

});