diff options
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/integration/run_tests.rs | 30 | ||||
-rw-r--r-- | cli/tests/testdata/lockfile/no_dts/deno.lock.out | 6 | ||||
-rw-r--r-- | cli/tests/testdata/lockfile/no_dts/main.cache.out | 2 | ||||
-rw-r--r-- | cli/tests/testdata/lockfile/no_dts/main.ts | 3 | ||||
-rw-r--r-- | cli/tests/testdata/lockfile/no_dts/mod.d.ts | 1 | ||||
-rw-r--r-- | cli/tests/testdata/lockfile/no_dts/mod.js | 4 |
6 files changed, 40 insertions, 6 deletions
diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index b4171e4a2..41711e678 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -805,10 +805,9 @@ itest!(private_field_presence_no_check { output: "run/private_field_presence.ts.out", }); -// TODO(bartlomieju): remove --unstable once Deno.Command is stabilized itest!(lock_write_fetch { args: - "run --quiet --allow-read --allow-write --allow-env --allow-run --unstable run/lock_write_fetch/main.ts", + "run --quiet --allow-read --allow-write --allow-env --allow-run run/lock_write_fetch/main.ts", output: "run/lock_write_fetch/main.out", http_server: true, exit_code: 0, @@ -856,10 +855,10 @@ itest!(config_file_lock_path { }); itest!(lock_flag_overrides_config_file_lock_path { - args: "run --lock=run/lock_check_ok2.json --config=run/config_file_lock_path.json run/019_media_types.ts", - output: "run/019_media_types.ts.out", - http_server: true, - }); + args: "run --lock=run/lock_check_ok2.json --config=run/config_file_lock_path.json run/019_media_types.ts", + output: "run/019_media_types.ts.out", + http_server: true, +}); itest!(lock_v2_check_ok { args: @@ -901,6 +900,25 @@ itest!(lock_only_http_and_https { http_server: true, }); +#[test] +fn lock_no_declaration_files() { + let context = TestContextBuilder::new() + .use_temp_cwd() + .use_http_server() + .build(); + let output = context + .new_command() + .args("cache --lock --lock-write $TESTDATA/lockfile/no_dts/main.ts") + .run(); + output.assert_matches_file("lockfile/no_dts/main.cache.out"); + let lockfile = context.temp_dir().path().join("deno.lock"); + lockfile.assert_matches_file( + context + .testdata_path() + .join("lockfile/no_dts/deno.lock.out"), + ); +} + itest!(mts_dmts_mjs { args: "run subdir/import.mts", output: "run/mts_dmts_mjs.out", diff --git a/cli/tests/testdata/lockfile/no_dts/deno.lock.out b/cli/tests/testdata/lockfile/no_dts/deno.lock.out new file mode 100644 index 000000000..9bf784113 --- /dev/null +++ b/cli/tests/testdata/lockfile/no_dts/deno.lock.out @@ -0,0 +1,6 @@ +{ + "version": "2", + "remote": { + "http://localhost:4545/lockfile/no_dts/mod.js": "3f576f37a301d298c3032eb1835240bd83f3762db26fc1d358c5d67088d6ffc8" + } +} diff --git a/cli/tests/testdata/lockfile/no_dts/main.cache.out b/cli/tests/testdata/lockfile/no_dts/main.cache.out new file mode 100644 index 000000000..ee8ad33ab --- /dev/null +++ b/cli/tests/testdata/lockfile/no_dts/main.cache.out @@ -0,0 +1,2 @@ +Download http://localhost:4545/lockfile/no_dts/mod.js +Download http://localhost:4545/lockfile/no_dts/mod.d.ts diff --git a/cli/tests/testdata/lockfile/no_dts/main.ts b/cli/tests/testdata/lockfile/no_dts/main.ts new file mode 100644 index 000000000..7596e1e1a --- /dev/null +++ b/cli/tests/testdata/lockfile/no_dts/main.ts @@ -0,0 +1,3 @@ +import { test } from "http://localhost:4545/lockfile/no_dts/mod.js"; + +console.log(test()); diff --git a/cli/tests/testdata/lockfile/no_dts/mod.d.ts b/cli/tests/testdata/lockfile/no_dts/mod.d.ts new file mode 100644 index 000000000..7d3fae61c --- /dev/null +++ b/cli/tests/testdata/lockfile/no_dts/mod.d.ts @@ -0,0 +1 @@ +export declare function test(): number; diff --git a/cli/tests/testdata/lockfile/no_dts/mod.js b/cli/tests/testdata/lockfile/no_dts/mod.js new file mode 100644 index 000000000..8ac948700 --- /dev/null +++ b/cli/tests/testdata/lockfile/no_dts/mod.js @@ -0,0 +1,4 @@ +/// <reference types="./mod.d.ts" /> +export function test() { + return 5; +} |