Skip to content

Commit

Permalink
Merge pull request #237 from storybookjs/kasper/sb-1133-test-runner23…
Browse files Browse the repository at this point in the history
…5-bug-nometa-error-with
  • Loading branch information
kasperpeulen committed Dec 28, 2022
2 parents 16bcf70 + 9eb3c32 commit 725761b
Show file tree
Hide file tree
Showing 12 changed files with 1,911 additions and 3,560 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Use Node.js 14.x
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 16.x

- name: Install dependencies
uses: bahmutov/npm-install@v1
Expand Down Expand Up @@ -102,10 +102,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Use Node.js 14.x
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 16.x

- name: Install dependencies
uses: bahmutov/npm-install@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
- name: Prepare repository
run: git fetch --unshallow --tags

- name: Use Node.js 14.x
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 16.x

- name: Install dependencies
uses: bahmutov/npm-install@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/stress-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Use Node.js 14.x
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 16.x

- name: Install dependencies
uses: bahmutov/npm-install@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests-extended.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Use Node.js 14.x
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 16.x

- name: Install dependencies
uses: bahmutov/npm-install@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Use Node.js 14.x
- name: Use Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 16.x

- name: Install dependencies
uses: bahmutov/npm-install@v1
Expand Down
File renamed without changes.
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@
},
"devDependencies": {
"@auto-it/released": "^10.37.1",
"@babel/cli": "^7.12.1",
"@babel/cli": "^7.20.7",
"@jest/types": "^28.1.3",
"@storybook/addon-coverage": "^0.0.5",
"@storybook/addon-coverage": "^0.0.7",
"@storybook/addon-essentials": "next",
"@storybook/addon-interactions": "next",
"@storybook/jest": "^0.0.10",
"@storybook/jest": "next",
"@storybook/react": "next",
"@storybook/react-webpack5": "next",
"@storybook/testing-library": "next",
Expand All @@ -76,14 +76,14 @@
"husky": "^8.0.0",
"jest-image-snapshot": "^5.1.0",
"lint-staged": "^13.0.3",
"prettier": "^2.3.1",
"prettier": "^2.8.1",
"prop-types": "^15.7.2",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"rimraf": "^3.0.2",
"storybook": "next",
"ts-jest": "^28.0.8",
"typescript": "^4.2.4",
"typescript": "~4.9.4",
"wait-on": "^6.0.0"
},
"lint-staged": {
Expand All @@ -100,13 +100,13 @@
"icon": "https://user-images.githubusercontent.com/321738/63501763-88dbf600-c4cc-11e9-96cd-94adadc2fd72.png"
},
"dependencies": {
"@babel/core": "^7.18.13",
"@babel/generator": "^7.18.13",
"@babel/preset-env": "^7.19.4",
"@babel/core": "^7.20.7",
"@babel/generator": "^7.20.7",
"@babel/preset-env": "^7.20.2",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.18.6",
"@babel/template": "^7.14.5",
"@babel/types": "^7.14.8",
"@babel/template": "^7.20.7",
"@babel/types": "^7.20.7",
"@storybook/core-common": "next",
"@storybook/csf": "next",
"@storybook/csf-tools": "next",
Expand All @@ -115,8 +115,8 @@
"commander": "^9.0.0",
"expect-playwright": "^0.8.0",
"jest": "^28.0.0",
"jest-environment-node":"^28.0.0",
"jest-circus":"^28.0.0",
"jest-circus": "^28.0.0",
"jest-environment-node": "^28.0.0",
"jest-junit": "^14.0.0",
"jest-playwright-preset": "^2.0.0",
"jest-runner": "^28.0.0",
Expand Down
24 changes: 0 additions & 24 deletions src/playwright/transformPlaywright.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,37 +66,29 @@ describe('Playwright', () => {
err: err.message
});
});
if (globalThis.__sbPreRender) {
await globalThis.__sbPreRender(page, context);
}
const result = await page.evaluate(({
id,
hasPlayFn
}) => __test(id, hasPlayFn), {
id: "example-foo-bar--a"
});
if (globalThis.__sbPostRender) {
await globalThis.__sbPostRender(page, context);
}
if (globalThis.__sbCollectCoverage) {
const isCoverageSetupCorrectly = await page.evaluate(() => '__coverage__' in window);
if (!isCoverageSetupCorrectly) {
throw new Error(\`[Test runner] An error occurred when evaluating code coverage:
The code in this story is not instrumented, which means the coverage setup is likely not correct.
More info: https://github.com/storybookjs/test-runner#setting-up-code-coverage\`);
}
await jestPlaywright.saveCoverage(page);
}
return result;
};
try {
await testFn();
} catch (err) {
Expand Down Expand Up @@ -144,37 +136,29 @@ describe('Playwright', () => {
err: err.message
});
});
if (globalThis.__sbPreRender) {
await globalThis.__sbPreRender(page, context);
}
const result = await page.evaluate(({
id,
hasPlayFn
}) => __test(id, hasPlayFn), {
id: "example-foo-bar--a"
});
if (globalThis.__sbPostRender) {
await globalThis.__sbPostRender(page, context);
}
if (globalThis.__sbCollectCoverage) {
const isCoverageSetupCorrectly = await page.evaluate(() => '__coverage__' in window);
if (!isCoverageSetupCorrectly) {
throw new Error(\`[Test runner] An error occurred when evaluating code coverage:
The code in this story is not instrumented, which means the coverage setup is likely not correct.
More info: https://github.com/storybookjs/test-runner#setting-up-code-coverage\`);
}
await jestPlaywright.saveCoverage(page);
}
return result;
};
try {
await testFn();
} catch (err) {
Expand Down Expand Up @@ -223,37 +207,29 @@ describe('Playwright', () => {
err: err.message
});
});
if (globalThis.__sbPreRender) {
await globalThis.__sbPreRender(page, context);
}
const result = await page.evaluate(({
id,
hasPlayFn
}) => __test(id, hasPlayFn), {
id: "example-header--a"
});
if (globalThis.__sbPostRender) {
await globalThis.__sbPostRender(page, context);
}
if (globalThis.__sbCollectCoverage) {
const isCoverageSetupCorrectly = await page.evaluate(() => '__coverage__' in window);
if (!isCoverageSetupCorrectly) {
throw new Error(\`[Test runner] An error occurred when evaluating code coverage:
The code in this story is not instrumented, which means the coverage setup is likely not correct.
More info: https://github.com/storybookjs/test-runner#setting-up-code-coverage\`);
}
await jestPlaywright.saveCoverage(page);
}
return result;
};
try {
await testFn();
} catch (err) {
Expand Down
Loading

0 comments on commit 725761b

Please sign in to comment.