Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #35 from storybookjs/next
Browse files Browse the repository at this point in the history
Release 0.1.0
  • Loading branch information
shilman authored Apr 3, 2023
2 parents 369da7b + 531954a commit 5c048d4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 24 deletions.
21 changes: 15 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,33 @@
"access": "public"
},
"dependencies": {
"@storybook/client-logger": "^6.4.0",
"@storybook/instrumenter": "^6.4.0",
"@storybook/client-logger": "^7.0.0-beta.0 || ^7.0.0-rc.0 || ^7.0.0",
"@storybook/instrumenter": "^7.0.0-beta.0 || ^7.0.0-rc.0 || ^7.0.0",
"@testing-library/dom": "^8.3.0",
"@testing-library/user-event": "^13.2.1",
"ts-dedent": "^2.2.0"
},
"devDependencies": {
"@auto-it/first-time-contributor": "^10.32.6",
"@auto-it/released": "^10.32.6",
"@auto-it/first-time-contributor": "^10.37.6",
"@auto-it/released": "^10.37.6",
"@storybook/linter-config": "^3.1.2",
"@types/react": "*",
"auto": "^10.32.6",
"auto": "^10.37.6",
"rimraf": "^3.0.2",
"typescript": "^4.4.3"
},
"auto": {
"prereleaseBranches": [
"next",
"prerelease"
],
"plugins": [
"npm",
[
"npm",
{
"legacyAuth": true
}
],
"first-time-contributor",
"released"
]
Expand Down
20 changes: 2 additions & 18 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,11 @@ import * as domTestingLibrary from '@testing-library/dom';
import _userEvent from '@testing-library/user-event';
import dedent from 'ts-dedent';

const debugOptions = {
timeout: 2147483647, // max valid timeout duration
interval: 2147483647,
};

const testingLibrary = instrument(
{ ...domTestingLibrary },
{
intercept: (method, path) => path[0] === 'fireEvent' || method.startsWith('findBy'),
getArgs: (call, state) => {
if (!state.isDebugging) return call.args;
if (call.method.startsWith('findBy')) {
const [value, queryOptions, waitForOptions] = call.args;
return [value, queryOptions, { ...waitForOptions, ...debugOptions }];
}
if (call.method.startsWith('waitFor')) {
const [callback, options] = call.args;
return [callback, { ...options, ...debugOptions }];
}
return call.args;
},
intercept: (method, path) =>
path[0] === 'fireEvent' || method.startsWith('findBy') || method.startsWith('waitFor'),
}
);

Expand Down

0 comments on commit 5c048d4

Please sign in to comment.