From a55d1ef3052796a3454dfd1d1076669f232bb695 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Mon, 11 Mar 2019 17:07:11 -0700 Subject: [PATCH] spec: chai is funky --- DEPS | 2 +- spec/package-lock.json | 24 +++++++++++++++++------- spec/package.json | 2 +- spec/static/index.html | 6 ++++++ 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/DEPS b/DEPS index fc7cde9dac34..0403ab4536a2 100644 --- a/DEPS +++ b/DEPS @@ -107,7 +107,7 @@ hooks = [ 'action': [ 'python', '-c', - 'import os, subprocess; os.chdir(os.path.join("src", "electron")); subprocess.check_call(["python", "script/lib/npm.py", "install"]);', + 'import os, subprocess; os.chdir(os.path.join("src", "electron")); subprocess.check_call(["python", "script/lib/npm.py", "ci"]);', ], }, { diff --git a/spec/package-lock.json b/spec/package-lock.json index 3ba22e9417a2..331e06744a5f 100644 --- a/spec/package-lock.json +++ b/spec/package-lock.json @@ -5,9 +5,8 @@ "requires": true, "dependencies": { "abstract-socket": { - "version": "github:nornagon/node-abstractsocket#7d9c770f9ffef14373349034f8820ff059879845", - "from": "github:nornagon/node-abstractsocket#v8-compat", - "dev": true, + "version": "2.0.0", + "resolved": "github:nornagon/node-abstractsocket#7d9c770f9ffef14373349034f8820ff059879845", "optional": true, "requires": { "bindings": "^1.2.1", @@ -66,7 +65,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.4.0.tgz", "integrity": "sha512-7znEVX22Djn+nYjxCWKDne0RRloa9XfYa84yk3s+HkE3LpDYZmhArYr9O9huBoHY3/oXispx5LorIX7Sl2CgSQ==", - "dev": true, "optional": true, "requires": { "file-uri-to-path": "1.0.0" @@ -285,6 +283,19 @@ "put": "0.0.6", "safe-buffer": "^5.1.1", "xml2js": "^0.4.17" + }, + "dependencies": { + "abstract-socket": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/abstract-socket/-/abstract-socket-2.0.0.tgz", + "integrity": "sha1-2DyT598w0n4j8+gqdj5/XnjZFvk=", + "dev": true, + "optional": true, + "requires": { + "bindings": "^1.2.1", + "nan": "^2.0.9" + } + } } }, "debug": { @@ -459,7 +470,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "dev": true, "optional": true }, "find-up": { @@ -778,7 +788,7 @@ }, "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "optional": true }, @@ -1151,7 +1161,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "optional": true, "requires": { diff --git a/spec/package.json b/spec/package.json index 38f6f328994f..fb0ddcaa2884 100644 --- a/spec/package.json +++ b/spec/package.json @@ -7,7 +7,6 @@ "postinstall": "node ../tools/run-if-exists.js node_modules/robotjs node-gyp rebuild" }, "devDependencies": { - "abstract-socket": "github:nornagon/node-abstractsocket#v8-compat", "basic-auth": "^2.0.1", "bluebird": "^3.5.3", "chai": "^4.2.0", @@ -33,6 +32,7 @@ "yargs": "^12.0.5" }, "optionalDependencies": { + "abstract-socket": "github:nornagon/node-abstractsocket#v8-compat", "robotjs": "github:nornagon/robotjs#node-12" } } diff --git a/spec/static/index.html b/spec/static/index.html index 059495c40069..a6e12db00a0e 100644 --- a/spec/static/index.html +++ b/spec/static/index.html @@ -17,6 +17,12 @@ const electron = require('electron') const { remote, ipcRenderer } = electron + // Set up chai-as-promised here first to avoid conflicts + // It must be loaded first or really strange things happen inside + // chai that cause test failures + // DO NOT MOVE, REMOVE OR EDIT THIS LINE + require('chai').use(require('chai-as-promised')) + // Check if we are running in CI. const isCi = remote.getGlobal('isCi')