Skip to content

Commit c21e703

Browse files
author
Robin Genske
committed
First commit
0 parents  commit c21e703

File tree

7 files changed

+5303
-0
lines changed

7 files changed

+5303
-0
lines changed

package-lock.json

Lines changed: 5240 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "jest-esm-test",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "src/index.js",
6+
"scripts": {
7+
"start": "node .",
8+
"lint": "eslint .",
9+
"test": "NODE_OPTIONS='--experimental-vm-modules' jest"
10+
},
11+
"author": "Robin",
12+
"license": "UNLICENSED",
13+
"dependencies": {
14+
"config": "^3.3.6",
15+
"pino": "^7.2.0",
16+
"ws": "^8.2.3"
17+
},
18+
"type": "module",
19+
"devDependencies": {
20+
"eslint": "^8.2.0",
21+
"eslint-config-airbnb-base": "^15.0.0",
22+
"eslint-plugin-import": "^2.25.3",
23+
"eslint-plugin-jest": "^25.2.4",
24+
"jest": "^27.3.1",
25+
"nodemon": "^2.0.15",
26+
"pino-pretty": "^7.2.0"
27+
}
28+
}

src/a.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const getCurrentState = () => {
2+
return 5;
3+
}

src/a.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { getCurrentState } from './a.js'
2+
3+
describe('a', () => {
4+
describe('getCurrentState', () => {
5+
it('it should return 5', () => {
6+
expect(getCurrentState()).toBe(5);
7+
})
8+
})
9+
})

src/b.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { WebSocketServer } from 'ws'
2+
import { createServer } from 'https'
3+
4+
export const getCurrentState = () => {
5+
const server = createServer({})
6+
const wss = new WebSocketServer({ server })
7+
8+
return 5
9+
}

src/b.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { getCurrentState } from './b.js'
2+
3+
describe('b', () => {
4+
describe('getCurrentState', () => {
5+
it('it should return 5', () => {
6+
expect(getCurrentState()).toBe(5);
7+
})
8+
})
9+
})

src/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { getCurrentState as aGetCurrentState } from './a.js'
2+
import { getCurrentState as bGetCurrentState } from './b.js'
3+
4+
aGetCurrentState()
5+
bGetCurrentState()

0 commit comments

Comments
 (0)