Skip to content

Commit

Permalink
fix: e2e test error
Browse files Browse the repository at this point in the history
  • Loading branch information
sanyuan0704 committed Nov 9, 2022
1 parent 46cb42e commit 84de728
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,5 @@ jobs:
- name: Lint
run: pnpm run lint

- name: Test unit
- name: Test unit and e2e
run: pnpm run test

- name: Test e2e
run: pnpm run e2e:test
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"pnpm-install": "pnpm install",
"lint": "eslint --ext .ts,.tsx,.js,.jsx --cache ./",
"lint:fix": "eslint --fix --ext .js,.jsx,.ts,.tsx --quiet --cache ./",
"test": "vitest run",
"test": "pnpm unit:test && pnpm e2e:test",
"unit:test": "vitest run",
"e2e:test": "playwright test",
"e2e:prepare": "tsx ./packages/island/scripts/prepare-e2e.cts",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
Expand Down
8 changes: 4 additions & 4 deletions packages/island/scripts/prepare-e2e.cts
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@ async function prepareE2E() {
// ensure after build
if (!fse.existsSync(path.resolve(__dirname, '../dist'))) {
// exec build command
execa.execaCommandSync('npm run build', {
execa.commandSync('npm run build', {
cwd: path.resolve(__dirname, '../')
});
}

execa.execaCommandSync('npx playwright install', {
execa.commandSync('npx playwright install', {
cwd: path.join(__dirname, '../'),
stdout: process.stdout,
stdin: process.stdin,
stderr: process.stderr
});

// exec install
execa.execaCommandSync(
execa.commandSync(
'npm i --registry=https://registry.npmmirror.com/',
defaultExecaOpts
);

// exec dev command
execa.execaCommandSync('npm run dev', defaultExecaOpts);
execa.commandSync('npm run dev', defaultExecaOpts);
}

prepareE2E();

0 comments on commit 84de728

Please sign in to comment.