Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support other test-runner config extensions #259

Merged
merged 1 commit into from
Feb 1, 2023

Conversation

yannbf
Copy link
Member

@yannbf yannbf commented Feb 1, 2023

Fixes #228 #91

The test runner will now support whatever extension you define for your storybook-test-runner.config.* file.
Additionally, it will look for that file under a custom config dir if passed with --config-dir.

Closes #248 #231

📦 Published PR as canary version: 0.9.4--canary.259.2b62dd1.0

✨ Test out this PR locally via:

npm install @storybook/test-runner@0.9.4--canary.259.2b62dd1.0
# or 
yarn add @storybook/test-runner@0.9.4--canary.259.2b62dd1.0

Version

Published prerelease version: v0.10.0-next.8

Changelog

🚀 Enhancement

🐛 Bug Fix

📝 Documentation

Authors: 7

@yannbf yannbf added the patch Increment the patch version when merged label Feb 1, 2023
@socket-security
Copy link

Socket Security Pull Request Report

Dependency issues detected. If you merge this pull request, you will not be alerted to the instances of these issues again.

📜 Install scripts

Install scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.

Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.

Package Script field Source
core-js-pure@3.27.0 (added) postinstall package.json via @storybook/react-webpack5@7.0.0-beta.15
⚠️ Uses eval

Package uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.

Avoid packages that use eval, since this could potentially execute any code.

Package Eval Type Location Source
core-js-pure@3.27.0 (added) Function internals/async-iterator-prototype.js package.json via @storybook/react-webpack5@7.0.0-beta.15
depd@2.0.0 (added) Function index.js package.json via @storybook/addon-essentials@7.0.0-beta.15, @storybook/addon-interactions@7.0.0-beta.15, @storybook/core-common@7.0.0-beta.15, @storybook/csf-tools@7.0.0-beta.15, @storybook/jest@0.0.11-next.0, @storybook/react@7.0.0-beta.15, @storybook/react-webpack5@7.0.0-beta.15, @storybook/store@7.0.0-beta.15, @storybook/testing-library@0.0.14-next.1, storybook@7.0.0-beta.15
ejs@3.1.8 (added) Function ejs-v3.1.8/ejs.js package.json via storybook@7.0.0-beta.15
ejs@3.1.8 (added) Function ejs-v3.1.8/ejs.js package.json via storybook@7.0.0-beta.15
ejs@3.1.8 (added) Function ejs-v3.1.8/ejs.min.js package.json via storybook@7.0.0-beta.15
ejs@3.1.8 (added) Function ejs-v3.1.8/ejs.min.js package.json via storybook@7.0.0-beta.15
ejs@3.1.8 (added) Function ejs-v3.1.8/lib/ejs.js package.json via storybook@7.0.0-beta.15
ejs@3.1.8 (added) Function ejs-v3.1.8/lib/ejs.js package.json via storybook@7.0.0-beta.15
envinfo@7.8.1 (added) Function dist/envinfo.js package.json via storybook@7.0.0-beta.15
envinfo@7.8.1 (added) Function dist/envinfo.js package.json via storybook@7.0.0-beta.15
esbuild-register@3.4.2 (added) Function dist/node.js package.json via @storybook/addon-essentials@7.0.0-beta.15, @storybook/addon-interactions@7.0.0-beta.15, @storybook/core-common@7.0.0-beta.15, @storybook/react@7.0.0-beta.15, @storybook/react-webpack5@7.0.0-beta.15, storybook@7.0.0-beta.15
handlebars@4.7.7 (added) Function dist/cjs/handlebars/compiler/javascript-compiler.js package.json via @storybook/addon-essentials@7.0.0-beta.15, @storybook/addon-interactions@7.0.0-beta.15, @storybook/core-common@7.0.0-beta.15, @storybook/react@7.0.0-beta.15, @storybook/react-webpack5@7.0.0-beta.15, storybook@7.0.0-beta.15
handlebars@4.7.7 (added) Function dist/cjs/handlebars/compiler/javascript-compiler.js package.json via @storybook/addon-essentials@7.0.0-beta.15, @storybook/addon-interactions@7.0.0-beta.15, @storybook/core-common@7.0.0-beta.15, @storybook/react@7.0.0-beta.15, @storybook/react-webpack5@7.0.0-beta.15, storybook@7.0.0-beta.15
handlebars@4.7.7 (added) Function dist/handlebars.amd.js package.json via @storybook/addon-essentials@7.0.0-beta.15, @storybook/addon-interactions@7.0.0-beta.15, @storybook/core-common@7.0.0-beta.15, @storybook/react@7.0.0-beta.15, @storybook/react-webpack5@7.0.0-beta.15, storybook@7.0.0-beta.15
handlebars@4.7.7 (added) Function dist/handlebars.amd.js package.json via @storybook/addon-essentials@7.0.0-beta.15, @storybook/addon-interactions@7.0.0-beta.15, @storybook/core-common@7.0.0-beta.15, @storybook/react@7.0.0-beta.15, @storybook/react-webpack5@7.0.0-beta.15, storybook@7.0.0-beta.15
handlebars@4.7.7 (added) Function dist/handlebars.amd.min.js package.json via @storybook/addon-essentials@7.0.0-beta.15, @storybook/addon-interactions@7.0.0-beta.15, @storybook/core-common@7.0.0-beta.15, @storybook/react@7.0.0-beta.15, @storybook/react-webpack5@7.0.0-beta.15, storybook@7.0.0-beta.15
handlebars@4.7.7 (added) Function dist/handlebars.amd.min.js package.json via @storybook/addon-essentials@7.0.0-beta.15, @storybook/addon-interactions@7.0.0-beta.15, @storybook/core-common@7.0.0-beta.15, @storybook/react@7.0.0-beta.15, @storybook/react-webpack5@7.0.0-beta.15, storybook@7.0.0-beta.15
is-callable@1.2.7 (added) Function test/index.js package.json via @storybook/jest@0.0.11-next.0, @storybook/react-webpack5@7.0.0-beta.15, @storybook/testing-library@0.0.14-next.1, storybook@7.0.0-beta.15
is-callable@1.2.7 (added) Function test/index.js package.json via @storybook/jest@0.0.11-next.0, @storybook/react-webpack5@7.0.0-beta.15, @storybook/testing-library@0.0.14-next.1, storybook@7.0.0-beta.15
is-generator-function@1.0.10 (added) Function index.js package.json via @storybook/react-webpack5@7.0.0-beta.15, storybook@7.0.0-beta.15
jest-diff@27.5.1 (added) Function build/index.js package.json via @storybook/jest@0.0.11-next.0, @types/jest@27.5.2
jest-snapshot@28.1.3 (added) Function build/utils.js package.json via jest@28.1.3, jest-circus@28.1.3, jest-image-snapshot@5.2.0, jest-playwright-preset@2.0.0, jest-runner@28.1.3, jest-watch-typeahead@2.2.1, ts-jest@28.0.8
js-yaml@3.14.1 (added) Function dist/js-yaml.js package.json via @storybook/addon-coverage@0.0.7, @storybook/addon-essentials@7.0.0-beta.15, babel-jest@28.1.3, babel-plugin-istanbul@6.1.1, jest@28.1.3, jest-circus@28.1.3, jest-image-snapshot@5.2.0, jest-playwright-preset@2.0.0, jest-runner@28.1.3, jest-watch-typeahead@2.2.1, ts-jest@28.0.8
js-yaml@3.14.1 (added) Function dist/js-yaml.js package.json via @storybook/addon-coverage@0.0.7, @storybook/addon-essentials@7.0.0-beta.15, babel-jest@28.1.3, babel-plugin-istanbul@6.1.1, jest@28.1.3, jest-circus@28.1.3, jest-image-snapshot@5.2.0, jest-playwright-preset@2.0.0, jest-runner@28.1.3, jest-watch-typeahead@2.2.1, ts-jest@28.0.8
js-yaml@3.14.1 (added) Function lib/js-yaml/type/js/function.js package.json via @storybook/addon-coverage@0.0.7, @storybook/addon-essentials@7.0.0-beta.15, babel-jest@28.1.3, babel-plugin-istanbul@6.1.1, jest@28.1.3, jest-circus@28.1.3, jest-image-snapshot@5.2.0, jest-playwright-preset@2.0.0, jest-runner@28.1.3, jest-watch-typeahead@2.2.1, ts-jest@28.0.8
js-yaml@3.14.1 (added) Function lib/js-yaml/type/js/function.js package.json via @storybook/addon-coverage@0.0.7, @storybook/addon-essentials@7.0.0-beta.15, babel-jest@28.1.3, babel-plugin-istanbul@6.1.1, jest@28.1.3, jest-circus@28.1.3, jest-image-snapshot@5.2.0, jest-playwright-preset@2.0.0, jest-runner@28.1.3, jest-watch-typeahead@2.2.1, ts-jest@28.0.8
lodash@4.17.21 (added) Function _root.js package.json via @storybook/addon-essentials@7.0.0-beta.15, @storybook/addon-interactions@7.0.0-beta.15, @storybook/csf@0.0.2-next.8, @storybook/csf-tools@7.0.0-beta.15, @storybook/jest@0.0.11-next.0, @storybook/react@7.0.0-beta.15, @storybook/react-webpack5@7.0.0-beta.15, @storybook/store@7.0.0-beta.15, @storybook/testing-library@0.0.14-next.1, concurrently@7.6.0, jest-image-snapshot@5.2.0, jest-playwright-preset@2.0.0, storybook@7.0.0-beta.15, wait-on@6.0.1
lodash@4.17.21 (added) Function template.js package.json via @storybook/addon-essentials@7.0.0-beta.15, @storybook/addon-interactions@7.0.0-beta.15, @storybook/csf@0.0.2-next.8, @storybook/csf-tools@7.0.0-beta.15, @storybook/jest@0.0.11-next.0, @storybook/react@7.0.0-beta.15, @storybook/react-webpack5@7.0.0-beta.15, @storybook/store@7.0.0-beta.15, @storybook/testing-library@0.0.14-next.1, concurrently@7.6.0, jest-image-snapshot@5.2.0, jest-playwright-preset@2.0.0, storybook@7.0.0-beta.15, wait-on@6.0.1
object-inspect@1.12.2 (added) Function test/bigint.js package.json via @storybook/addon-essentials@7.0.0-beta.15, @storybook/addon-interactions@7.0.0-beta.15, @storybook/core-common@7.0.0-beta.15, @storybook/csf-tools@7.0.0-beta.15, @storybook/jest@0.0.11-next.0, @storybook/react@7.0.0-beta.15, @storybook/react-webpack5@7.0.0-beta.15, @storybook/store@7.0.0-beta.15, @storybook/testing-library@0.0.14-next.1, lint-staged@13.1.0, storybook@7.0.0-beta.15
object-inspect@1.12.2 (added) Function test/bigint.js package.json via @storybook/addon-essentials@7.0.0-beta.15, @storybook/addon-interactions@7.0.0-beta.15, @storybook/core-common@7.0.0-beta.15, @storybook/csf-tools@7.0.0-beta.15, @storybook/jest@0.0.11-next.0, @storybook/react@7.0.0-beta.15, @storybook/react-webpack5@7.0.0-beta.15, @storybook/store@7.0.0-beta.15, @storybook/testing-library@0.0.14-next.1, lint-staged@13.1.0, storybook@7.0.0-beta.15
object-inspect@1.12.2 (added) Function test/bigint.js package.json via @storybook/addon-essentials@7.0.0-beta.15, @storybook/addon-interactions@7.0.0-beta.15, @storybook/core-common@7.0.0-beta.15, @storybook/csf-tools@7.0.0-beta.15, @storybook/jest@0.0.11-next.0, @storybook/react@7.0.0-beta.15, @storybook/react-webpack5@7.0.0-beta.15, @storybook/store@7.0.0-beta.15, @storybook/testing-library@0.0.14-next.1, lint-staged@13.1.0, storybook@7.0.0-beta.15
playwright-core@1.29.1 (added) Function lib/server/javascript.js package.json via jest-playwright-preset@2.0.0, playwright@1.29.1
playwright-core@1.29.1 (added) Function lib/server/javascript.js package.json via jest-playwright-preset@2.0.0, playwright@1.29.1
pngjs@6.0.0 (added) Function browser.js package.json via jest-image-snapshot@5.2.0
pngjs@6.0.0 (added) Function browser.js package.json via jest-image-snapshot@5.2.0
pretty-format@27.5.1 (added) Function build/plugins/AsymmetricMatcher.js package.json via @storybook/jest@0.0.11-next.0, @storybook/testing-library@0.0.14-next.1, @types/jest@27.5.2
pretty-format@27.5.1 (added) Function build/plugins/ReactTestComponent.js package.json via @storybook/jest@0.0.11-next.0, @storybook/testing-library@0.0.14-next.1, @types/jest@27.5.2
puppeteer-core@2.1.1 (added) Function lib/Browser.js package.json via storybook@7.0.0-beta.15
puppeteer-core@2.1.1 (added) Function lib/DOMWorld.js package.json via storybook@7.0.0-beta.15
puppeteer-core@2.1.1 (added) Function lib/ExecutionContext.js package.json via storybook@7.0.0-beta.15
puppeteer-core@2.1.1 (added) Function lib/ExecutionContext.js package.json via storybook@7.0.0-beta.15
telejson@7.0.4 (added) Function dist/index.js package.json via @storybook/addon-essentials@7.0.0-beta.15, @storybook/addon-interactions@7.0.0-beta.15, @storybook/jest@0.0.11-next.0, @storybook/react@7.0.0-beta.15, @storybook/react-webpack5@7.0.0-beta.15, @storybook/store@7.0.0-beta.15, @storybook/testing-library@0.0.14-next.1, storybook@7.0.0-beta.15
telejson@7.0.4 (added) Function dist/index.js package.json via @storybook/addon-essentials@7.0.0-beta.15, @storybook/addon-interactions@7.0.0-beta.15, @storybook/jest@0.0.11-next.0, @storybook/react@7.0.0-beta.15, @storybook/react-webpack5@7.0.0-beta.15, @storybook/store@7.0.0-beta.15, @storybook/testing-library@0.0.14-next.1, storybook@7.0.0-beta.15
telejson@7.0.4 (added) Function dist/index.js package.json via @storybook/addon-essentials@7.0.0-beta.15, @storybook/addon-interactions@7.0.0-beta.15, @storybook/jest@0.0.11-next.0, @storybook/react@7.0.0-beta.15, @storybook/react-webpack5@7.0.0-beta.15, @storybook/store@7.0.0-beta.15, @storybook/testing-library@0.0.14-next.1, storybook@7.0.0-beta.15
telejson@7.0.4 (added) Function dist/index.mjs package.json via @storybook/addon-essentials@7.0.0-beta.15, @storybook/addon-interactions@7.0.0-beta.15, @storybook/jest@0.0.11-next.0, @storybook/react@7.0.0-beta.15, @storybook/react-webpack5@7.0.0-beta.15, @storybook/store@7.0.0-beta.15, @storybook/testing-library@0.0.14-next.1, storybook@7.0.0-beta.15
telejson@7.0.4 (added) Function dist/index.mjs package.json via @storybook/addon-essentials@7.0.0-beta.15, @storybook/addon-interactions@7.0.0-beta.15, @storybook/jest@0.0.11-next.0, @storybook/react@7.0.0-beta.15, @storybook/react-webpack5@7.0.0-beta.15, @storybook/store@7.0.0-beta.15, @storybook/testing-library@0.0.14-next.1, storybook@7.0.0-beta.15
telejson@7.0.4 (added) Function dist/index.mjs package.json via @storybook/addon-essentials@7.0.0-beta.15, @storybook/addon-interactions@7.0.0-beta.15, @storybook/jest@0.0.11-next.0, @storybook/react@7.0.0-beta.15, @storybook/react-webpack5@7.0.0-beta.15, @storybook/store@7.0.0-beta.15, @storybook/testing-library@0.0.14-next.1, storybook@7.0.0-beta.15
uglify-js@3.17.4 (added) Function tools/node.js package.json via @storybook/addon-essentials@7.0.0-beta.15, @storybook/addon-interactions@7.0.0-beta.15, @storybook/core-common@7.0.0-beta.15, @storybook/react@7.0.0-beta.15, @storybook/react-webpack5@7.0.0-beta.15, storybook@7.0.0-beta.15
Pull request report summary
Issue Status
Install scripts ⚠️ 1 issue
Native code ✅ 0 issues
Bin script confusion ✅ 0 issues
Bin script shell injection ✅ 0 issues
Shell access ✅ 0 issues
Uses eval ⚠️ 48 issues
Unresolved require ✅ 0 issues
Invalid package.json ✅ 0 issues
HTTP dependency ✅ 0 issues
Git dependency ✅ 0 issues
GitHub dependency ✅ 0 issues
New author ✅ 0 issues
Potential typo squat ✅ 0 issues
Known Malware ✅ 0 issues
Telemetry ✅ 0 issues
Protestware/Troll package ✅ 0 issues
AI detected malware ✅ 0 issues
Bot Commands

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@2.4.2

  • @SocketSecurity ignore core-js-pure@3.27.0
  • @SocketSecurity ignore depd@2.0.0
  • @SocketSecurity ignore ejs@3.1.8
  • @SocketSecurity ignore envinfo@7.8.1
  • @SocketSecurity ignore esbuild-register@3.4.2

Powered by socket.dev

@yannbf yannbf force-pushed the fix/support-other-config-extensions branch from 82ca20e to 2b62dd1 Compare February 1, 2023 17:03
@yannbf
Copy link
Member Author

yannbf commented Feb 1, 2023

Sorry for replacing both of your PRs @bryanjtc @sterashima78, but this PR solves the issue while being flexible and not introducing any new flags to users. Thanks a lot for your contributions!

@hansottowirtz you might also want to know about this

@yannbf yannbf merged commit 942a3cc into next Feb 1, 2023
@yannbf yannbf deleted the fix/support-other-config-extensions branch February 1, 2023 17:13
yannbf added a commit that referenced this pull request Feb 1, 2023
…ensions

Support other test-runner config extensions
@yannbf yannbf mentioned this pull request Feb 1, 2023
@github-actions github-actions bot mentioned this pull request Mar 31, 2023
@github-actions github-actions bot mentioned this pull request Apr 3, 2023
@github-actions
Copy link

github-actions bot commented Apr 3, 2023

🚀 PR was released in v0.10.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged prerelease released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: look for test-runner-jest.config.js first from config dir specified with -c
1 participant