From 7309443a9b138fb1c2aa09f106cec043f8dc42dd Mon Sep 17 00:00:00 2001 From: Jeremy Rifkin <51220084+jeremy-rifkin@users.noreply.github.com> Date: Sun, 29 Jan 2023 18:58:11 -0500 Subject: [PATCH] Setup TS testing infrastructure (#4659) --- package-lock.json | 13 +++++++++++++ package.json | 3 ++- ...{ansi-to-html-tests.js => ansi-to-html-tests.ts} | 1 - 3 files changed, 15 insertions(+), 2 deletions(-) rename test/{ansi-to-html-tests.js => ansi-to-html-tests.ts} (98%) diff --git a/package-lock.json b/package-lock.json index f59f6e22099..de715bf2f14 100644 --- a/package-lock.json +++ b/package-lock.json @@ -93,6 +93,7 @@ "@types/express": "^4.17.14", "@types/fs-extra": "^9.0.13", "@types/jquery": "^3.5.10", + "@types/mocha": "^8.2.2", "@types/qs": "^6.9.7", "@types/shell-quote": "^1.7.1", "@types/tar-fs": "^2.0.1", @@ -1895,6 +1896,12 @@ "integrity": "sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==", "dev": true }, + "node_modules/@types/mocha": { + "version": "8.2.3", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-8.2.3.tgz", + "integrity": "sha512-ekGvFhFgrc2zYQoX4JeZPmVzZxw6Dtllga7iGHzfbYIYkAMUx/sAFP2GdFpLff+vdHXu5fl7WX9AT+TtqYcsyw==", + "dev": true + }, "node_modules/@types/node": { "version": "18.11.18", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz", @@ -17044,6 +17051,12 @@ "integrity": "sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==", "dev": true }, + "@types/mocha": { + "version": "8.2.3", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-8.2.3.tgz", + "integrity": "sha512-ekGvFhFgrc2zYQoX4JeZPmVzZxw6Dtllga7iGHzfbYIYkAMUx/sAFP2GdFpLff+vdHXu5fl7WX9AT+TtqYcsyw==", + "dev": true + }, "@types/node": { "version": "18.11.18", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz", diff --git a/package.json b/package.json index b1d14b2f37d..21568dcbcc3 100644 --- a/package.json +++ b/package.json @@ -104,6 +104,7 @@ "@types/express": "^4.17.14", "@types/fs-extra": "^9.0.13", "@types/jquery": "^3.5.10", + "@types/mocha": "^8.2.2", "@types/qs": "^6.9.7", "@types/shell-quote": "^1.7.1", "@types/tar-fs": "^2.0.1", @@ -172,7 +173,7 @@ "lint": "eslint . --fix", "lint-check": "eslint .", "lint-files": "eslint", - "test": "mocha -b", + "test": "mocha -b -r ts-node/register 'test/**/*.ts' 'test/**/*.js'", "test-min": "mocha -b --config .mocharc-min.yml", "fix": "npm run lint && npm run format && npm run ts-check", "check": "npm run ts-check && npm run lint-check && npm run test-min -- --reporter min", diff --git a/test/ansi-to-html-tests.js b/test/ansi-to-html-tests.ts similarity index 98% rename from test/ansi-to-html-tests.js rename to test/ansi-to-html-tests.ts index c7188179799..93f8059086f 100644 --- a/test/ansi-to-html-tests.js +++ b/test/ansi-to-html-tests.ts @@ -22,7 +22,6 @@ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. -// TODO(supergrecko): Re-enable these once TS test infrastructure is up import {Filter} from '../static/ansi-to-html'; describe('ansi-to-html', () => {