|
1 | | -[ |
| 1 | +const { join } = require('path') |
| 2 | + |
| 3 | +module.exports = [ |
2 | 4 | { |
3 | 5 | args: ["run", "test/fixtures/ts-interop/interop.ts"], |
4 | 6 | expect: { code: 0 } |
|
18 | 20 | { |
19 | 21 | args: ["build", "test/integration/test.ts", "-o", "tmp"], |
20 | 22 | expect (code, stdout, stderr) { |
21 | | - return stdout.toString().indexOf('tmp/index.js') !== -1; |
| 23 | + return stdout.toString().indexOf(join('tmp', 'index.js')) !== -1; |
22 | 24 | } |
23 | 25 | }, |
24 | 26 | { |
|
71 | 73 | { |
72 | 74 | args: ["build", "-o", "tmp", "test/fixtures/test.cjs"], |
73 | 75 | expect (code, stdout, stderr) { |
74 | | - return stdout.toString().indexOf('tmp/index.cjs') !== -1; |
| 76 | + return stdout.toString().indexOf(join('tmp', 'index.cjs')) !== -1; |
75 | 77 | } |
76 | 78 | }, |
77 | 79 | { |
78 | 80 | args: ["build", "-o", "tmp", "test/fixtures/test.mjs"], |
79 | 81 | expect (code, stdout, stderr) { |
80 | | - return stdout.toString().indexOf('tmp/index.mjs') !== -1; |
| 82 | + return stdout.toString().indexOf(join('tmp', 'index.mjs')) !== -1; |
81 | 83 | } |
82 | 84 | }, |
83 | 85 | { |
84 | 86 | args: ["build", "-o", "tmp", "test/fixtures/test.mjs", "--stats-out", "tmp/stats.json"], |
85 | 87 | expect (code, stdout, stderr) { |
86 | 88 | const fs = require('fs'); |
87 | 89 | try { |
88 | | - JSON.parse(fs.readFileSync('tmp/stats.json', 'utf8')); |
| 90 | + JSON.parse(fs.readFileSync(join('tmp', 'stats.json'), 'utf8')); |
89 | 91 | } catch { |
90 | 92 | return false; |
91 | 93 | } |
|
112 | 114 | args: ["build", "-o", "tmp", "test/fixtures/module.cjs"], |
113 | 115 | expect (code, stdout) { |
114 | 116 | const fs = require('fs'); |
115 | | - return code === 0 && fs.readFileSync('tmp/index.js', 'utf8').toString().indexOf('export {') === -1; |
| 117 | + return code === 0 && fs.readFileSync(join('tmp', 'index.js'), 'utf8').toString().indexOf('export {') === -1; |
116 | 118 | } |
117 | 119 | } |
118 | 120 | ] |
0 commit comments