summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2018-11-05 06:52:31 +1100
committerRyan Dahl <ry@tinyclouds.org>2018-11-04 11:52:31 -0800
commit4e07783663d51877e7d41465cf5ef10d1540c4b3 (patch)
treef02336f4f46e8330362f1409d1c298db50dcc98a /tests
parente93d686e9d5e797f7e4e02bda56a8b6d535326ca (diff)
Improve integration test harness (#1142)
Diffstat (limited to 'tests')
-rw-r--r--tests/001_hello.test2
-rw-r--r--tests/002_hello.test2
-rw-r--r--tests/003_relative_import.test2
-rw-r--r--tests/004_set_timeout.test2
-rw-r--r--tests/005_more_imports.test2
-rw-r--r--tests/006_url_imports.test2
-rw-r--r--tests/010_set_interval.test2
-rw-r--r--tests/012_async.test2
-rw-r--r--tests/013_dynamic_import.test2
-rw-r--r--tests/014_duplicate_import.test2
-rw-r--r--tests/015_import_no_ext.test2
-rw-r--r--tests/016_double_await.test2
-rw-r--r--tests/017_import_redirect.test2
-rw-r--r--tests/018_async_catch.test2
-rw-r--r--tests/019_media_types.test2
-rw-r--r--tests/020_json_modules.test2
-rw-r--r--tests/README.md15
-rw-r--r--tests/async_error.test3
-rw-r--r--tests/error_001.test3
-rw-r--r--tests/error_002.test3
-rw-r--r--tests/error_003_typescript.test3
-rw-r--r--tests/error_004_missing_module.test3
-rw-r--r--tests/error_005_missing_dynamic_import.test3
-rw-r--r--tests/error_006_import_ext_failure.test3
-rw-r--r--tests/error_007_any.test3
-rw-r--r--tests/error_008_checkjs.test3
-rw-r--r--tests/exit_error42.test3
-rw-r--r--tests/https_import.test2
-rw-r--r--tests/types.out15
-rw-r--r--tests/types.test2
30 files changed, 96 insertions, 0 deletions
diff --git a/tests/001_hello.test b/tests/001_hello.test
new file mode 100644
index 000000000..9db00485d
--- /dev/null
+++ b/tests/001_hello.test
@@ -0,0 +1,2 @@
+args: tests/001_hello.js --reload
+output: tests/002_hello.ts.out
diff --git a/tests/002_hello.test b/tests/002_hello.test
new file mode 100644
index 000000000..881271a97
--- /dev/null
+++ b/tests/002_hello.test
@@ -0,0 +1,2 @@
+args: tests/002_hello.ts --reload
+output: tests/002_hello.ts.out
diff --git a/tests/003_relative_import.test b/tests/003_relative_import.test
new file mode 100644
index 000000000..42336ba22
--- /dev/null
+++ b/tests/003_relative_import.test
@@ -0,0 +1,2 @@
+args: tests/003_relative_import.ts --reload
+output: tests/003_relative_import.ts.out
diff --git a/tests/004_set_timeout.test b/tests/004_set_timeout.test
new file mode 100644
index 000000000..ea47ef1f3
--- /dev/null
+++ b/tests/004_set_timeout.test
@@ -0,0 +1,2 @@
+args: tests/004_set_timeout.ts --reload
+output: tests/004_set_timeout.ts.out
diff --git a/tests/005_more_imports.test b/tests/005_more_imports.test
new file mode 100644
index 000000000..998047a7b
--- /dev/null
+++ b/tests/005_more_imports.test
@@ -0,0 +1,2 @@
+args: tests/005_more_imports.ts --reload
+output: tests/005_more_imports.ts.out
diff --git a/tests/006_url_imports.test b/tests/006_url_imports.test
new file mode 100644
index 000000000..c7210c83c
--- /dev/null
+++ b/tests/006_url_imports.test
@@ -0,0 +1,2 @@
+args: tests/006_url_imports.ts --reload
+output: tests/006_url_imports.ts.out
diff --git a/tests/010_set_interval.test b/tests/010_set_interval.test
new file mode 100644
index 000000000..f7c7a1f00
--- /dev/null
+++ b/tests/010_set_interval.test
@@ -0,0 +1,2 @@
+args: tests/010_set_interval.ts --reload
+output: tests/010_set_interval.ts.out
diff --git a/tests/012_async.test b/tests/012_async.test
new file mode 100644
index 000000000..7bfe0a3c5
--- /dev/null
+++ b/tests/012_async.test
@@ -0,0 +1,2 @@
+args: tests/012_async.ts --reload
+output: tests/012_async.ts.out
diff --git a/tests/013_dynamic_import.test b/tests/013_dynamic_import.test
new file mode 100644
index 000000000..8fe463b20
--- /dev/null
+++ b/tests/013_dynamic_import.test
@@ -0,0 +1,2 @@
+args: tests/013_dynamic_import.ts --reload
+output: tests/013_dynamic_import.ts.out
diff --git a/tests/014_duplicate_import.test b/tests/014_duplicate_import.test
new file mode 100644
index 000000000..57d5b6e8b
--- /dev/null
+++ b/tests/014_duplicate_import.test
@@ -0,0 +1,2 @@
+args: tests/014_duplicate_import.ts --reload
+output: tests/014_duplicate_import.ts.out
diff --git a/tests/015_import_no_ext.test b/tests/015_import_no_ext.test
new file mode 100644
index 000000000..1d084704c
--- /dev/null
+++ b/tests/015_import_no_ext.test
@@ -0,0 +1,2 @@
+args: tests/015_import_no_ext.ts --reload
+output: tests/015_import_no_ext.ts.out
diff --git a/tests/016_double_await.test b/tests/016_double_await.test
new file mode 100644
index 000000000..0e5c1babc
--- /dev/null
+++ b/tests/016_double_await.test
@@ -0,0 +1,2 @@
+args: tests/016_double_await.ts --reload
+output: tests/016_double_await.ts.out
diff --git a/tests/017_import_redirect.test b/tests/017_import_redirect.test
new file mode 100644
index 000000000..4550a2f76
--- /dev/null
+++ b/tests/017_import_redirect.test
@@ -0,0 +1,2 @@
+args: tests/017_import_redirect.ts --reload
+output: tests/017_import_redirect.ts.out
diff --git a/tests/018_async_catch.test b/tests/018_async_catch.test
new file mode 100644
index 000000000..582ff2b35
--- /dev/null
+++ b/tests/018_async_catch.test
@@ -0,0 +1,2 @@
+args: tests/018_async_catch.ts --reload
+output: tests/018_async_catch.ts.out
diff --git a/tests/019_media_types.test b/tests/019_media_types.test
new file mode 100644
index 000000000..28b14e641
--- /dev/null
+++ b/tests/019_media_types.test
@@ -0,0 +1,2 @@
+args: tests/019_media_types.ts --reload
+output: tests/019_media_types.ts.out
diff --git a/tests/020_json_modules.test b/tests/020_json_modules.test
new file mode 100644
index 000000000..d9e9467fa
--- /dev/null
+++ b/tests/020_json_modules.test
@@ -0,0 +1,2 @@
+args: tests/020_json_modules.ts --reload
+output: tests/020_json_modules.ts.out
diff --git a/tests/README.md b/tests/README.md
new file mode 100644
index 000000000..080fcdd15
--- /dev/null
+++ b/tests/README.md
@@ -0,0 +1,15 @@
+# Integration Tests
+
+This path contains integration tests. When the integration tests are run, the
+test harness will execute tests which are defined in a `.test` file and located
+in the base of this path.
+
+A `.test` file is a simple configuration format where each option is specified
+on a single line. The key is the string to the left of the `:` deliminator and
+the value is the string to the right.
+
+| Key | Required | Description |
+| ----------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `args` | Yes | Specifies the command line arguments for the test. This should typically be input script for the test and a `--reload` to help ensure Deno doesn't leverage the cache. |
+| `output` | Yes | This is a text file which represents the output of the command. The string `[WILDCARD]` can be used in the output to specify ranges of text which any output is accepted. |
+| `exit_code` | No | If not present, it is assumed the script would exit normally (`0`). If specified, the harness will ensure the proper code is received. |
diff --git a/tests/async_error.test b/tests/async_error.test
new file mode 100644
index 000000000..6734876c5
--- /dev/null
+++ b/tests/async_error.test
@@ -0,0 +1,3 @@
+exit_code: 1
+args: tests/async_error.ts --reload
+output: tests/async_error.ts.out
diff --git a/tests/error_001.test b/tests/error_001.test
new file mode 100644
index 000000000..549b00995
--- /dev/null
+++ b/tests/error_001.test
@@ -0,0 +1,3 @@
+args: tests/error_001.ts --reload
+exit_code: 1
+output: tests/error_001.ts.out
diff --git a/tests/error_002.test b/tests/error_002.test
new file mode 100644
index 000000000..e7eb6c83c
--- /dev/null
+++ b/tests/error_002.test
@@ -0,0 +1,3 @@
+args: tests/error_002.ts --reload
+exit_code: 1
+output: tests/error_002.ts.out
diff --git a/tests/error_003_typescript.test b/tests/error_003_typescript.test
new file mode 100644
index 000000000..cacce54cc
--- /dev/null
+++ b/tests/error_003_typescript.test
@@ -0,0 +1,3 @@
+args: tests/error_003_typescript.ts --reload
+exit_code: 1
+output: tests/error_003_typescript.ts.out
diff --git a/tests/error_004_missing_module.test b/tests/error_004_missing_module.test
new file mode 100644
index 000000000..6f584e56a
--- /dev/null
+++ b/tests/error_004_missing_module.test
@@ -0,0 +1,3 @@
+args: tests/error_004_missing_module.ts --reload
+exit_code: 1
+output: tests/error_004_missing_module.ts.out
diff --git a/tests/error_005_missing_dynamic_import.test b/tests/error_005_missing_dynamic_import.test
new file mode 100644
index 000000000..826b3345d
--- /dev/null
+++ b/tests/error_005_missing_dynamic_import.test
@@ -0,0 +1,3 @@
+args: tests/error_005_missing_dynamic_import.ts --reload
+exit_code: 1
+output: tests/error_005_missing_dynamic_import.ts.out
diff --git a/tests/error_006_import_ext_failure.test b/tests/error_006_import_ext_failure.test
new file mode 100644
index 000000000..90a625a17
--- /dev/null
+++ b/tests/error_006_import_ext_failure.test
@@ -0,0 +1,3 @@
+args: tests/error_006_import_ext_failure.ts --reload
+exit_code: 1
+output: tests/error_006_import_ext_failure.ts.out
diff --git a/tests/error_007_any.test b/tests/error_007_any.test
new file mode 100644
index 000000000..2c63c932a
--- /dev/null
+++ b/tests/error_007_any.test
@@ -0,0 +1,3 @@
+args: tests/error_007_any.ts --reload
+exit_code: 1
+output: tests/error_007_any.ts.out
diff --git a/tests/error_008_checkjs.test b/tests/error_008_checkjs.test
new file mode 100644
index 000000000..eebd64aaf
--- /dev/null
+++ b/tests/error_008_checkjs.test
@@ -0,0 +1,3 @@
+args: tests/error_008_checkjs.js --reload
+exit_code: 1
+output: tests/error_008_checkjs.js.out
diff --git a/tests/exit_error42.test b/tests/exit_error42.test
new file mode 100644
index 000000000..59e4cd3d2
--- /dev/null
+++ b/tests/exit_error42.test
@@ -0,0 +1,3 @@
+exit_code: 42
+args: tests/exit_error42.ts --reload
+output: tests/exit_error42.ts.out
diff --git a/tests/https_import.test b/tests/https_import.test
new file mode 100644
index 000000000..e308466be
--- /dev/null
+++ b/tests/https_import.test
@@ -0,0 +1,2 @@
+args: tests/https_import.ts --reload
+output: tests/https_import.ts.out
diff --git a/tests/types.out b/tests/types.out
new file mode 100644
index 000000000..be91ae044
--- /dev/null
+++ b/tests/types.out
@@ -0,0 +1,15 @@
+// Copyright 2018 the Deno authors. All rights reserved. MIT license.
+
+/// <reference no-default-lib="true" />
+/// <reference lib="esnext" />
+[WILDCARD]
+declare module "deno" {
+[WILDCARD]
+}
+
+declare interface Window {
+[WILDCARD]
+}
+
+declare const window: Window;
+[WILDCARD]
diff --git a/tests/types.test b/tests/types.test
new file mode 100644
index 000000000..e70ed5503
--- /dev/null
+++ b/tests/types.test
@@ -0,0 +1,2 @@
+args: --types
+output: tests/types.out