summaryrefslogtreecommitdiff
path: root/tests/specs/compile/include_data_files/__test__.jsonc
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-11-19 16:19:35 -0500
committerGitHub <noreply@github.com>2024-11-19 16:19:35 -0500
commit46b6037644c761369e689704f8e7b857959da155 (patch)
treea863a8ad6f91a8907d96f50215105a478c6d53ff /tests/specs/compile/include_data_files/__test__.jsonc
parentc55e936be03a3a023330789f903e2fbd12f4a308 (diff)
feat(compile): ability to embed local data files (#26934)
``` > deno compile --allow-read=. --include data-file.txt main.js ``` This only applies to files on the filesystem. For remote modules, that's going to have to wait for `import ... from "./data.txt" with { "type": "bytes" }` or whatever it will be.
Diffstat (limited to 'tests/specs/compile/include_data_files/__test__.jsonc')
-rw-r--r--tests/specs/compile/include_data_files/__test__.jsonc41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/specs/compile/include_data_files/__test__.jsonc b/tests/specs/compile/include_data_files/__test__.jsonc
new file mode 100644
index 000000000..5d5d967ca
--- /dev/null
+++ b/tests/specs/compile/include_data_files/__test__.jsonc
@@ -0,0 +1,41 @@
+{
+ "tempDir": true,
+ "tests": {
+ "success": {
+ "steps": [{
+ "if": "unix",
+ "args": "compile --allow-read=data-file.txt --include data-file.txt --output main main.js",
+ "output": "[WILDCARD]"
+ }, {
+ "if": "unix",
+ "commandName": "./main",
+ "args": [],
+ "output": "output.out",
+ "exitCode": 0
+ }, {
+ "if": "windows",
+ "args": "compile --allow-read=data-file.txt --include data-file.txt --output main.exe main.js",
+ "output": "[WILDCARD]"
+ }, {
+ "if": "windows",
+ "commandName": "./main.exe",
+ "args": [],
+ "output": "output.out",
+ "exitCode": 0
+ }]
+ },
+ "non_existent": {
+ "steps": [{
+ "if": "unix",
+ "args": "compile --include does_not_exist.txt --output main main.js",
+ "output": "non_existent.out",
+ "exitCode": 1
+ }, {
+ "if": "windows",
+ "args": "compile --include does_not_exist.txt --output main.exe main.js",
+ "output": "non_existent.out",
+ "exitCode": 1
+ }]
+ }
+ }
+}