react-code-dataset / next.js /packages /next-codemod /transforms /__tests__ /url-to-withrouter.test.js
Download next.js/packages/next-codemod/transforms/__tests__/url-to-withrouter.test.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 821 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next-codemod/transforms/__tests__/url-to-withrouter.test.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/packages/next-codemod/transforms/__tests__/url-to-withrouter.test.js
-
curl -L -o url-to-withrouter.test.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next-codemod/transforms/__tests__/url-to-withrouter.test.js
821 Bytes
| /* global jest */ | |
| jest.autoMockOff() | |
| const defineTest = require('jscodeshift/dist/testUtils').defineTest | |
| const fixtures = [ | |
| 'with-router-import', | |
| 'without-import', | |
| 'already-using-withrouter', | |
| 'using-inline-class', | |
| 'export-default-variable', | |
| 'export-default-variable-wrapping', | |
| 'no-transform', | |
| 'no-transform-method', | |
| 'wrapping-export', | |
| 'variable-export', | |
| 'arrow-function-component', | |
| 'destructuring-this', | |
| 'destructuring-this-class', | |
| 'destructuring-this-props', | |
| 'destructuring-this-props-nested', | |
| 'with-nested-arrow-function', | |
| 'componentdidupdate', | |
| 'componentwillreceiveprops', | |
| 'first-parameter-hoc', | |
| 'url-property-not-part-of-this-props', | |
| ] | |
| for (const fixture of fixtures) { | |
| defineTest( | |
| __dirname, | |
| 'url-to-withrouter', | |
| null, | |
| `url-to-withrouter/${fixture}` | |
| ) | |
| } | |