diff options
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/integration/run_tests.rs | 34 | ||||
-rw-r--r-- | cli/tests/testdata/run/lock_v2_check_err.json | 7 | ||||
-rw-r--r-- | cli/tests/testdata/run/lock_v2_check_err.out | 3 | ||||
-rw-r--r-- | cli/tests/testdata/run/lock_v2_check_err2.json | 13 | ||||
-rw-r--r-- | cli/tests/testdata/run/lock_v2_check_err2.out | 3 | ||||
-rw-r--r-- | cli/tests/testdata/run/lock_v2_check_ok.json | 7 | ||||
-rw-r--r-- | cli/tests/testdata/run/lock_v2_check_ok2.json | 13 | ||||
-rw-r--r-- | cli/tests/testdata/run/lock_v2_dynamic_imports.json | 9 | ||||
-rw-r--r-- | cli/tests/testdata/run/lock_v2_dynamic_imports.out | 4 |
9 files changed, 93 insertions, 0 deletions
diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index 156940185..71b26b356 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -658,6 +658,40 @@ itest!(lock_check_err2 { http_server: true, }); +itest!(lock_v2_check_ok { + args: + "run --lock=run/lock_v2_check_ok.json http://127.0.0.1:4545/run/003_relative_import.ts", + output: "run/003_relative_import.ts.out", + http_server: true, +}); + +itest!(lock_v2_check_ok2 { + args: "run --lock=run/lock_v2_check_ok2.json run/019_media_types.ts", + output: "run/019_media_types.ts.out", + http_server: true, +}); + +itest!(lock_v2_dynamic_imports { + args: "run --lock=run/lock_v2_dynamic_imports.json --allow-read --allow-net http://127.0.0.1:4545/run/013_dynamic_import.ts", + output: "run/lock_v2_dynamic_imports.out", + exit_code: 10, + http_server: true, +}); + +itest!(lock_v2_check_err { + args: "run --lock=run/lock_v2_check_err.json http://127.0.0.1:4545/run/003_relative_import.ts", + output: "run/lock_v2_check_err.out", + exit_code: 10, + http_server: true, +}); + +itest!(lock_v2_check_err2 { + args: "run --lock=run/lock_v2_check_err2.json run/019_media_types.ts", + output: "run/lock_v2_check_err2.out", + exit_code: 10, + http_server: true, +}); + itest!(mts_dmts_mjs { args: "run subdir/import.mts", output: "run/mts_dmts_mjs.out", diff --git a/cli/tests/testdata/run/lock_v2_check_err.json b/cli/tests/testdata/run/lock_v2_check_err.json new file mode 100644 index 000000000..6bd6491c6 --- /dev/null +++ b/cli/tests/testdata/run/lock_v2_check_err.json @@ -0,0 +1,7 @@ +{ + "version": "2", + "remote": { + "http://127.0.0.1:4545/subdir/print_hello.ts": "fa6692c8f9ff3fb107e773c3ece5274e9d08be282867a1e3ded1d9c00fcaa63c", + "http://127.0.0.1:4545/run/003_relative_import.ts": "bad" + } +} diff --git a/cli/tests/testdata/run/lock_v2_check_err.out b/cli/tests/testdata/run/lock_v2_check_err.out new file mode 100644 index 000000000..28ad01cf4 --- /dev/null +++ b/cli/tests/testdata/run/lock_v2_check_err.out @@ -0,0 +1,3 @@ +[WILDCARD]The source code is invalid, as it does not match the expected hash in the lock file. + Specifier: http://127.0.0.1:4545/run/003_relative_import.ts + Lock file: run/lock_v2_check_err.json diff --git a/cli/tests/testdata/run/lock_v2_check_err2.json b/cli/tests/testdata/run/lock_v2_check_err2.json new file mode 100644 index 000000000..30fbcdf4b --- /dev/null +++ b/cli/tests/testdata/run/lock_v2_check_err2.json @@ -0,0 +1,13 @@ +{ + "version": "2", + "remote": { + "http://localhost:4545/subdir/mt_application_ecmascript.j2.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_application_x_javascript.j4.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_application_x_typescript.t4.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_text_ecmascript.j3.js": "bad", + "http://localhost:4545/subdir/mt_text_javascript.j1.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_text_typescript.t1.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_video_mp2t.t3.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_video_vdn.t2.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18" + } +} diff --git a/cli/tests/testdata/run/lock_v2_check_err2.out b/cli/tests/testdata/run/lock_v2_check_err2.out new file mode 100644 index 000000000..3d82cba27 --- /dev/null +++ b/cli/tests/testdata/run/lock_v2_check_err2.out @@ -0,0 +1,3 @@ +[WILDCARD]The source code is invalid, as it does not match the expected hash in the lock file. + Specifier: http://localhost:4545/subdir/mt_text_ecmascript.j3.js + Lock file: run/lock_v2_check_err2.json diff --git a/cli/tests/testdata/run/lock_v2_check_ok.json b/cli/tests/testdata/run/lock_v2_check_ok.json new file mode 100644 index 000000000..63bec862a --- /dev/null +++ b/cli/tests/testdata/run/lock_v2_check_ok.json @@ -0,0 +1,7 @@ +{ + "version": "2", + "remote": { + "http://127.0.0.1:4545/subdir/print_hello.ts": "fa6692c8f9ff3fb107e773c3ece5274e9d08be282867a1e3ded1d9c00fcaa63c", + "http://127.0.0.1:4545/run/003_relative_import.ts": "a1572e8fd2c2712b33f04aed2561505b5feb2c8696f1f2cded3de7127931b97e" + } +} diff --git a/cli/tests/testdata/run/lock_v2_check_ok2.json b/cli/tests/testdata/run/lock_v2_check_ok2.json new file mode 100644 index 000000000..4356c9421 --- /dev/null +++ b/cli/tests/testdata/run/lock_v2_check_ok2.json @@ -0,0 +1,13 @@ +{ + "version": "2", + "remote": { + "http://localhost:4545/subdir/mt_application_ecmascript.j2.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_application_x_javascript.j4.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_application_x_typescript.t4.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_text_ecmascript.j3.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_text_javascript.j1.js": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_text_typescript.t1.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_video_mp2t.t3.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18", + "http://localhost:4545/subdir/mt_video_vdn.t2.ts": "3a3e002e2f92dc8f045bd4a7c66b4791453ad0417b038dd2b2d9d0f277c44f18" + } +} diff --git a/cli/tests/testdata/run/lock_v2_dynamic_imports.json b/cli/tests/testdata/run/lock_v2_dynamic_imports.json new file mode 100644 index 000000000..eadbee272 --- /dev/null +++ b/cli/tests/testdata/run/lock_v2_dynamic_imports.json @@ -0,0 +1,9 @@ +{ + "version": "2", + "remote": { + "http://127.0.0.1:4545/run/013_dynamic_import.ts": "3f83e653329dc1f963761a986997d710b9763f667fc243eef89b3a5decacda30", + "http://127.0.0.1:4545/subdir/mod1.ts": "bfc1037b02c99abc20367f739bca7455813a5950066abd77965bff33b6eece0f", + "http://127.0.0.1:4545/subdir/print_hello.ts": "fa6692c8f9ff3fb107e773c3ece5274e9d08be282867a1e3ded1d9c00fcaa63c", + "http://127.0.0.1:4545/subdir/subdir2/mod2.ts": "bad" + } +} diff --git a/cli/tests/testdata/run/lock_v2_dynamic_imports.out b/cli/tests/testdata/run/lock_v2_dynamic_imports.out new file mode 100644 index 000000000..36c2c9b5c --- /dev/null +++ b/cli/tests/testdata/run/lock_v2_dynamic_imports.out @@ -0,0 +1,4 @@ +[WILDCARD] +error: The source code is invalid, as it does not match the expected hash in the lock file. + Specifier: http://127.0.0.1:4545/subdir/subdir2/mod2.ts + Lock file: run/lock_v2_dynamic_imports.json |