diff options
| author | David Sherret <dsherret@users.noreply.github.com> | 2021-08-11 10:20:47 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-11 10:20:47 -0400 |
| commit | 15a763152f9d392cb80692262f8de5ef8ae15495 (patch) | |
| tree | fcd1a59777f95920bf3502519983d6cc0d882a9a /cli/tests/integration/bundle_tests.rs | |
| parent | a0285e2eb88f6254f6494b0ecd1878db3a3b2a58 (diff) | |
chore: move test files to testdata directory (#11601)
Diffstat (limited to 'cli/tests/integration/bundle_tests.rs')
| -rw-r--r-- | cli/tests/integration/bundle_tests.rs | 62 |
1 files changed, 30 insertions, 32 deletions
diff --git a/cli/tests/integration/bundle_tests.rs b/cli/tests/integration/bundle_tests.rs index 1ef1a39f5..4e68af0b1 100644 --- a/cli/tests/integration/bundle_tests.rs +++ b/cli/tests/integration/bundle_tests.rs @@ -7,12 +7,12 @@ use test_util as util; #[test] fn bundle_exports() { // First we have to generate a bundle of some module that has exports. - let mod1 = util::root_path().join("cli/tests/subdir/mod1.ts"); + let mod1 = util::testdata_path().join("subdir/mod1.ts"); assert!(mod1.is_file()); let t = TempDir::new().expect("tempdir fail"); let bundle = t.path().join("mod1.bundle.js"); let mut deno = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("bundle") .arg(mod1) .arg(&bundle) @@ -33,7 +33,7 @@ fn bundle_exports() { .expect("error writing file"); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg(&test) .output() @@ -49,12 +49,12 @@ fn bundle_exports() { #[test] fn bundle_exports_no_check() { // First we have to generate a bundle of some module that has exports. - let mod1 = util::root_path().join("cli/tests/subdir/mod1.ts"); + let mod1 = util::testdata_path().join("subdir/mod1.ts"); assert!(mod1.is_file()); let t = TempDir::new().expect("tempdir fail"); let bundle = t.path().join("mod1.bundle.js"); let mut deno = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("bundle") .arg("--no-check") .arg(mod1) @@ -76,7 +76,7 @@ fn bundle_exports_no_check() { .expect("error writing file"); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg(&test) .output() @@ -92,12 +92,12 @@ fn bundle_exports_no_check() { #[test] fn bundle_circular() { // First we have to generate a bundle of some module that has exports. - let circular1 = util::root_path().join("cli/tests/subdir/circular1.ts"); + let circular1 = util::testdata_path().join("subdir/circular1.ts"); assert!(circular1.is_file()); let t = TempDir::new().expect("tempdir fail"); let bundle = t.path().join("circular1.bundle.js"); let mut deno = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("bundle") .arg(circular1) .arg(&bundle) @@ -108,7 +108,7 @@ fn bundle_circular() { assert!(bundle.is_file()); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg(&bundle) .output() @@ -124,13 +124,12 @@ fn bundle_circular() { #[test] fn bundle_single_module() { // First we have to generate a bundle of some module that has exports. - let single_module = - util::root_path().join("cli/tests/subdir/single_module.ts"); + let single_module = util::testdata_path().join("subdir/single_module.ts"); assert!(single_module.is_file()); let t = TempDir::new().expect("tempdir fail"); let bundle = t.path().join("single_module.bundle.js"); let mut deno = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("bundle") .arg(single_module) .arg(&bundle) @@ -141,7 +140,7 @@ fn bundle_single_module() { assert!(bundle.is_file()); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg(&bundle) .output() @@ -157,12 +156,12 @@ fn bundle_single_module() { #[test] fn bundle_tla() { // First we have to generate a bundle of some module that has exports. - let tla_import = util::root_path().join("cli/tests/subdir/tla.ts"); + let tla_import = util::testdata_path().join("subdir/tla.ts"); assert!(tla_import.is_file()); let t = tempfile::TempDir::new().expect("tempdir fail"); let bundle = t.path().join("tla.bundle.js"); let mut deno = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("bundle") .arg(tla_import) .arg(&bundle) @@ -183,7 +182,7 @@ fn bundle_tla() { .expect("error writing file"); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg(&test) .output() @@ -199,12 +198,12 @@ fn bundle_tla() { #[test] fn bundle_js() { // First we have to generate a bundle of some module that has exports. - let mod6 = util::root_path().join("cli/tests/subdir/mod6.js"); + let mod6 = util::testdata_path().join("subdir/mod6.js"); assert!(mod6.is_file()); let t = TempDir::new().expect("tempdir fail"); let bundle = t.path().join("mod6.bundle.js"); let mut deno = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("bundle") .arg(mod6) .arg(&bundle) @@ -215,7 +214,7 @@ fn bundle_js() { assert!(bundle.is_file()); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg(&bundle) .output() @@ -227,13 +226,12 @@ fn bundle_js() { #[test] fn bundle_dynamic_import() { let _g = util::http_server(); - let dynamic_import = - util::root_path().join("cli/tests/bundle_dynamic_import.ts"); + let dynamic_import = util::testdata_path().join("bundle_dynamic_import.ts"); assert!(dynamic_import.is_file()); let t = TempDir::new().expect("tempdir fail"); let bundle = t.path().join("bundle_dynamic_import.bundle.js"); let mut deno = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("bundle") .arg(dynamic_import) .arg(&bundle) @@ -244,7 +242,7 @@ fn bundle_dynamic_import() { assert!(bundle.is_file()); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg("--allow-net") .arg("--quiet") @@ -261,13 +259,13 @@ fn bundle_dynamic_import() { #[test] fn bundle_import_map() { - let import = util::root_path().join("cli/tests/bundle_im.ts"); - let import_map_path = util::root_path().join("cli/tests/bundle_im.json"); + let import = util::testdata_path().join("bundle_im.ts"); + let import_map_path = util::testdata_path().join("bundle_im.json"); assert!(import.is_file()); let t = TempDir::new().expect("tempdir fail"); let bundle = t.path().join("import_map.bundle.js"); let mut deno = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("bundle") .arg("--import-map") .arg(import_map_path) @@ -290,7 +288,7 @@ fn bundle_import_map() { .expect("error writing file"); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg(&test) .output() @@ -305,13 +303,13 @@ fn bundle_import_map() { #[test] fn bundle_import_map_no_check() { - let import = util::root_path().join("cli/tests/bundle_im.ts"); - let import_map_path = util::root_path().join("cli/tests/bundle_im.json"); + let import = util::testdata_path().join("bundle_im.ts"); + let import_map_path = util::testdata_path().join("bundle_im.json"); assert!(import.is_file()); let t = TempDir::new().expect("tempdir fail"); let bundle = t.path().join("import_map.bundle.js"); let mut deno = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("bundle") .arg("--no-check") .arg("--import-map") @@ -335,7 +333,7 @@ fn bundle_import_map_no_check() { .expect("error writing file"); let output = util::deno_cmd() - .current_dir(util::root_path()) + .current_dir(util::testdata_path()) .arg("run") .arg(&test) .output() @@ -349,7 +347,7 @@ fn bundle_import_map_no_check() { } itest!(lock_check_err_with_bundle { - args: "bundle --lock=lock_check_err_with_bundle.json http://127.0.0.1:4545/cli/tests/subdir/mod1.ts", + args: "bundle --lock=lock_check_err_with_bundle.json http://127.0.0.1:4545/subdir/mod1.ts", output: "lock_check_err_with_bundle.out", exit_code: 10, http_server: true, |
