Skip to content

Commit 1b31856

Browse files
committed
thank u win32.
1 parent 82a0f2c commit 1b31856

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

tests/integration/cli/build/build.test.ts

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os from 'node:os';
12
import path from 'node:path';
23
import { stripVTControlCharacters as stripAnsi } from 'node:util';
34
import { describe, expect, test } from '@rstest/core';
@@ -150,33 +151,34 @@ describe('build command', async () => {
150151
runCliSync('build --format cjs', {
151152
cwd: fixturePath,
152153
}),
153-
).toThrowError(/rslib\.config not found in.*cli\/build\/no-config/);
154+
).toThrowError(/rslib\.config not found in.*cli[\\/]build[\\/]no-config/);
154155
});
155156

156157
test('build options', async () => {
157158
const fixturePath = path.join(__dirname, 'options');
158159
await fse.remove(path.join(fixturePath, 'dist/ok'));
159160

160-
const stdout = runCliSync(
161+
const command =
161162
'build ' +
162-
'--entry="./src/*" ' +
163-
'--dist-path=dist/ok ' +
164-
'--no-bundle ' +
165-
'--format=esm ' +
166-
`--syntax='["node 14", "Chrome 103"]' ` +
167-
'--target=web ' +
168-
'--dts=true ' +
169-
'--externals=./bar ' +
170-
'--minify=false ' +
171-
'--auto-extension=false',
172-
{
173-
cwd: fixturePath,
174-
env: {
175-
...process.env,
176-
DEBUG: 'rslib',
177-
},
163+
'--entry="./src/*" ' +
164+
'--dist-path=dist/ok ' +
165+
'--no-bundle ' +
166+
'--format=esm ' +
167+
`--syntax='["node 14", "Chrome 103"]' ` +
168+
'--target=web ' +
169+
'--dts=true ' +
170+
'--externals=./bar ' +
171+
'--minify=false ' +
172+
'--auto-extension=false';
173+
174+
const stdout = runCliSync(command, {
175+
cwd: fixturePath,
176+
shell: os.platform() === 'win32' ? 'powershell.exe' : undefined,
177+
env: {
178+
...process.env,
179+
DEBUG: 'rslib',
178180
},
179-
);
181+
});
180182

181183
const rslibConfigText = stripAnsi(extractRslibConfig(stdout));
182184
expect(rslibConfigText).toMatchInlineSnapshot(`

0 commit comments

Comments
 (0)