forked from microsoft/botbuilder-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-consumer-test.js
More file actions
40 lines (36 loc) · 1.35 KB
/
run-consumer-test.js
File metadata and controls
40 lines (36 loc) · 1.35 KB
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
const execa = require('execa');
// TODO: ANTLR breaks 3.1
let versions = [/* '3.1', */ '3.2', '3.3', '3.4', '3.5', '3.6'];
if (!process.env.SKIP_LATEST) {
versions.push('latest');
}
async function exec(cmd) {
const command = execa(cmd, { cwd: './consumer-test', shell: true });
command.stderr.pipe(process.stderr);
command.stdout.pipe(process.stdout);
return command;
}
(async () => {
try {
console.log('Running typescript consumer test againast', versions);
await exec('npm init -y');
console.log('Setting up typescript consumer project');
// await exec('npm install --save ./..');
// console.log('Installing @azure/cosmos as a file dependency');
for (const version of versions) {
console.log(`Compling with typescript@${ version } - Basic`);
await exec(
`npx -p typescript@${ version } tsc ./test.ts --allowSyntheticDefaultImports true`
);
console.log(`Compling with typescript@${ version } - Custom lib`);
await exec(
`npx -p typescript@${ version } tsc ./test.ts --allowSyntheticDefaultImports true --lib es2018`
);
}
process.exit(0);
} catch (error) {
console.log('Typescript consumer test failed!');
console.log(error);
process.exit(1);
}
})();