forked from vercel/turborepo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Disable HMR for snapshot tests The only effect is that we don't emit source maps for the individual chunk items, reducing the total number of output files considerably. * Extract snapshot tests into separate crate * Strip annoying file hash fingerprints * Reduce deps * Update old references to turbopack/test/snapshot * Move node_modules out of snapshot dir * Only un-fingerprint EcmascriptChunkSourceMapAssetVc source maps * Fix gitignore * Remove dbg * TAPLO * Apply suggestions from code review Co-authored-by: Alex Kirszenberg <[email protected]> * Use eprintln Co-authored-by: Alex Kirszenberg <[email protected]>
- Loading branch information
1 parent
c9a563e
commit e7815fd
Showing
301 changed files
with
484 additions
and
1,002 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
crates/turbopack/tests/snapshot/*/output/** linguist-generated=true | ||
crates/turbopack-tests/tests/snapshot/**/output/** linguist-generated=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[package] | ||
name = "turbopack-tests" | ||
version = "0.1.0" | ||
description = "TBD" | ||
license = "MPL-2.0" | ||
edition = "2021" | ||
autobenches = false | ||
|
||
# don't publish this crate | ||
publish = false | ||
|
||
[dev-dependencies] | ||
anyhow = "1.0.47" | ||
once_cell = "1.13.0" | ||
serde = "1.0.136" | ||
serde_json = "1.0.85" | ||
similar = "2.2.0" | ||
test-generator = "0.3.0" | ||
tokio = "1.11.0" | ||
turbo-tasks = { path = "../turbo-tasks" } | ||
turbo-tasks-env = { path = "../turbo-tasks-env" } | ||
turbo-tasks-fs = { path = "../turbo-tasks-fs" } | ||
turbo-tasks-memory = { path = "../turbo-tasks-memory" } | ||
turbopack = { path = "../turbopack" } | ||
turbopack-core = { path = "../turbopack-core" } | ||
turbopack-ecmascript = { path = "../turbopack-ecmascript" } | ||
turbopack-env = { path = "../turbopack-env" } | ||
|
||
[build-dependencies] | ||
turbo-tasks-build = { path = "../turbo-tasks-build" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# turbopack-tests | ||
|
||
An extracted create to perform snapshot tests on turbopack. | ||
|
||
## Testing | ||
|
||
It's possible to only run the snapshot tests using [nextest][]'s filter | ||
expressions: | ||
|
||
```bash | ||
cargo nextest run -E 'test(snapshot)' | ||
``` | ||
|
||
The filter supports any substring, and only test names which contain | ||
that substring will run. | ||
|
||
## Updating Snapshot | ||
|
||
If you've made a change that requires many snapshot updates, you can | ||
automatically update all outputs using the `UPDATE` command line env: | ||
|
||
```bash | ||
UPDATE=1 cargo nextest run -E 'test(snapshot)' | ||
``` | ||
|
||
[nextest]: https://nexte.st/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use turbo_tasks_build::{generate_register, rerun_if_glob}; | ||
|
||
fn main() { | ||
generate_register(); | ||
// The test/snapshot crate need to be rebuilt if any snapshots are added. | ||
// Unfortunately, we can't have the build.rs file operate differently on | ||
// each file, so the entire turbopack crate needs to be rebuilt. | ||
rerun_if_glob("tests/snapshot/*/*", "test/snapshot"); | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/node_modules | ||
# include everything in the snapshots dir | ||
!snapshot/** | ||
|
File renamed without changes.
Oops, something went wrong.