rsnext/packages/next-swc/crates/next-dev/Cargo.toml
Will Binns-Smith 7bd5321b09 next-dev test runner (vercel/turbo#172)
This is a very early version of the next-dev test runner. I'm opening this early to get thoughts from folks re: the direction of the design and implementation.

Fixes vercel/turbo#204 

Currently it:
* Discovers integration test fixtures from the filesystem. Right now these are expected to be single files that get bundled and will eventually include assertions. This is powered by the test-generator crate, which allows us not to have to manually enumerate each case. We could consider using this for the node-file-trace tests as well.
* Starts the dev server on a free port and opens a headless browser to its root. The browser control is implemented with the https://crates.io/crates/chromiumoxide crate, which expects Chrome or Chromium to already be available.

Eventually it will:
* [x] Implement a minimal test environment loaded in the browser so that assertions can be run there from bundled code.
* [x] Report back the results of these assertions to rust, where we can pass/fail cargo tests with those results.

In the future it could:
* Possibly include snapshot-style tests to assert on transformed results. This could be in the form of fixture directories instead of files cc @jridgewell
* Support expressing special configuration of turbopack in a fixture, possibly as another file in the fixture directory.
* [x] ~Possibly support distributing tests to a pool of open browsers instead of opening and closing for each test.~

Test Plan: See next PRs
2022-08-09 16:20:30 +00:00

50 lines
1.2 KiB
TOML

[package]
name = "next-dev"
version = "0.1.0"
edition = "2021"
[[bin]]
name = "next-dev"
path = "src/main.rs"
bench = false
[lib]
bench = false
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
tokio_console = [
"dep:console-subscriber",
"tokio/tracing",
"turbo-tasks/tokio_tracing",
]
[dependencies]
anyhow = "1.0.47"
clap = { version = "3.1.3", features = ["derive"] }
console-subscriber = { version = "0.1.6", optional = true }
futures = "0.3.21"
json = "0.12.4"
mime = "0.3.16"
serde = "1.0.136"
tokio = { version = "1.11.0", features = ["full"] }
turbo-tasks = { path = "../turbo-tasks" }
turbo-tasks-fs = { path = "../turbo-tasks-fs" }
turbo-tasks-memory = { path = "../turbo-tasks-memory" }
turbopack = { path = "../turbopack" }
turbopack-cli-utils = { path = "../turbopack-cli-utils" }
turbopack-core = { path = "../turbopack-core" }
turbopack-dev-server = { path = "../turbopack-dev-server" }
webbrowser = "0.7.1"
[dev-dependencies]
chromiumoxide = { version = "0.3.5", features = [
"tokio-runtime",
], default-features = false }
lazy_static = "1.4.0"
portpicker = "0.1.1"
test-generator = "0.3.0"
[build-dependencies]
turbo-tasks-build = { path = "../turbo-tasks-build" }