Commit graph

15 commits

Author SHA1 Message Date
David Ramos
36a6e436b3
Don't swallow test failures caused by POSIX signals (#32688)
* Don't swallow test failures caused by POSIX signals

* Update tests to not import() inside jest

* Update tests

* apply suggestion

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2021-12-21 12:52:07 -06:00
Tim Neutkens
0196b03621
Experimental next/jest config helper (#31246)
* Experimental next/jest config helper

Co-Authored-By: Maia Teegarden <dev@padmaia.rocks>

* Ensure useTypescript is provided

* Move experimental warning to next/jest

* Remove unused code

* Remove unused imports

Co-authored-by: Maia Teegarden <dev@padmaia.rocks>
2021-11-10 16:16:15 -08:00
Maia Teegarden
bc88831619
Add next-swc jest transform (#30993)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2021-11-08 17:35:04 +01:00
Tim Neutkens
7e370134fb
Use import() to load next.config.js (#29935)
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Co-authored-by: Steven <steven@ceriously.com>
2021-10-16 14:22:42 +02:00
JJ Kasper
a92a5caec2
Update test set-up to leverage playwright when able to (#28634)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-09-13 14:36:25 +02:00
JJ Kasper
005b13f1ac
Move unit tests to one folder and migrate them to TypeScript (#28427)
* Move unit tests to one folder

* Migrate unit tests to TypeScript

* add test types to lint

* Ensure ts(x) tests are run with util

* Add tsx extension to jest config

* bump
2021-08-24 07:52:45 -05:00
JJ Kasper
ece79a4e00
Update test config to leverage swc (#28400)
This updates our `jest` configuration to no longer use `babel-jest` and instead uses `@swc/jest` which is much faster. This also updates to the latest version of `jest`, fixes our `tsconfig.json` used for tests (previously types in `node_modules` weren't resolved correctly), and ensures `next/dist` isn't un-necessarily transpiled in `jest`. 

Timings for `yarn testheadless test/unit/` on CI
- before: 3m 30s - 4m ([example run](https://github.com/vercel/next.js/runs/3394701995))
- after: under 1m ([example run](https://github.com/vercel/next.js/pull/28400/checks?check_run_id=3395161621))

Timings for `yarn testheadless test/unit/` locally on m1 mac 
- before: 90.16 seconds
- after: 29.92 seconds
2021-08-23 18:36:56 +00:00
Shu Ding
1bf4cf3e76
Upgrade jest-worker (#23077)
This PR upgrades `jest-worker` and `jest-cli` to the latest pre-release version, also removed `jest-circus` which is included in Jest by default. `jest-worker@next` includes a fix for memory leak that we need (https://github.com/facebook/jest/pull/11187). 

Fixes #22925. This will also improve the OOM issue for `next dev` #15855.
2021-03-16 21:08:35 +00:00
Jan Potoms
32057c849d
Use the jest-circus test runner (#12974) 2020-05-16 16:56:06 -04:00
JJ Kasper
8390a474fe
Update to output jest data for posting failed tests comment (#10814)
* Update to output jest data for posting failed tests comment

* Add failing test

* Reset retries

* Revert change for testing
2020-03-04 09:54:49 +01:00
Joe Haddad
18a9c7e371
Improve linting rules to catch more errors (#9374)
* Update `packages/`

* Update examples

* Update tests

* Update bench

* Update top level files

* Fix build

* trigger
2019-11-10 19:24:53 -08:00
JJ Kasper
5f40306575 Remove coveralls (#7689) 2019-06-28 09:09:27 -04:00
JJ Kasper
533018f7d0 Update tests for BrowserStack (#6810)
Update tests to setup webdriver stuff in `jest-environment` and re-use one browser session instead of spawning one for each webdriver call to prevent creating too many BrowserStack sessions.
2019-03-29 16:05:53 +01:00
Vagisha Nidhi
d43d305092 Test reports are not being published to Azure Pipelines (#5715)
This PR is related to the issue #5713 
The PR helps to publish test results for reporting in Azure Pipelines.

Azure Pipelines provides excellent reporting capabilities that can be leveraged by this PR.
An example report is shown in the image below.
![image](https://user-images.githubusercontent.com/13175100/48767951-e8a73580-ecdd-11e8-8e6a-20d7767d7c1b.png)
2018-11-22 10:12:12 +01:00
Henrik Wenz
95a6a872b6 Refactor test setup (#5391)
- [x] Move jest config from npm scripts to `jest.config.js`
- [x] Remove obsolete cross-env package (we don't need it anymore 🎉)
- [x] Fix bug where tests are not waiting for webdriver to be ready.
2018-10-12 15:32:17 +02:00