Skip to content

Commit

Permalink
test: add test for issue 1813
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan committed Apr 9, 2020
1 parent f8cc8df commit 00a4c20
Show file tree
Hide file tree
Showing 5 changed files with 1,820 additions and 10 deletions.
18 changes: 18 additions & 0 deletions internal/linker/test/issue_1813/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
load("@npm//jest-cli:index.bzl", "jest_test")

jest_test(
name = "test",
args = [
"--config",
"$(rootpath jest.config.js)",
"--runTestsByPath",
"$(rootpath index.test.js)",
],
data = [
"index.test.js",
"jest.config.js",
"@npm//jest",
"@npm//jest-websocket-mock",
"@npm//mock-socket",
],
)
13 changes: 13 additions & 0 deletions internal/linker/test/issue_1813/index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Loaded from common-js format
// node_modules/jest-websocket-mock/lib/jest-websocket-mock.cjs.js
const WS = require('jest-websocket-mock').default;
// Loaded from js format
// node_modules/mock-socket/dist/mock-socket.js"
const Server = require('mock-socket').Server;

test('jest-websocket-mock', () => {
const ws = new WS('ws://localhost:1234');
console.log(ws.server.constructor); // [Function: Server] { of: [Function: of] }
console.log(Server); // [Function: Server] { of: [Function: of] }
expect(ws.server).toBeInstanceOf(Server); // FAILS
});
Empty file.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
"jasmine": "~3.4.0",
"jasmine-core": "~3.4.0",
"jasmine-reporters": "~2.3.2",
"jest": "~25.3.0",
"jest-websocket-mock": "~2.0.2",
"karma": "~4.1.0",
"karma-chrome-launcher": "2.2.0",
"karma-firefox-launcher": "1.1.0",
Expand All @@ -51,6 +53,7 @@
"karma-sourcemap-loader": "0.3.7",
"lit-element": "^2.2.1",
"minimist": "^1.2.2",
"mock-socket": "~9.0.3",
"node_resolve_index": "file:./tools/npm_packages/node_resolve_index",
"node_resolve_index_2": "file:./tools/npm_packages/node_resolve_index_2",
"node_resolve_index_3": "file:./tools/npm_packages/node_resolve_index_3",
Expand Down
Loading

0 comments on commit 00a4c20

Please sign in to comment.