Skip to content

Commit c835c9c

Browse files
committed
fix issues with workflow; remove unused function
1 parent 39fe3bf commit c835c9c

File tree

9 files changed

+26
-26
lines changed

9 files changed

+26
-26
lines changed

.github/workflows/tests.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,28 @@ jobs:
2222
- name: Build
2323
run: npm run build
2424

25-
- name: Cache lib
25+
- name: Cache lib and node_modules
2626
uses: actions/cache@v3
2727
with:
28-
path: lib
28+
path: |
29+
lib
30+
node_modules
2931
key: ${{ runner.os }}-ipos-lib-${{ github.sha }}
3032

3133
test:
34+
needs: [ build ]
3235
name: Test
3336
runs-on: ubuntu-latest
3437
steps:
3538
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
3639
- uses: actions/checkout@v3
3740

38-
- name: Cache lib
41+
- name: Cache lib and node_modules
3942
uses: actions/cache@v3
4043
with:
41-
path: lib
44+
path: |
45+
lib
46+
node_modules
4247
key: ${{ runner.os }}-ipos-lib-${{ github.sha }}
4348

4449
- name: Run Tests

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
lib
2+
coverage
23
ipos-*.tgz

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.idea/
22
.nvmrc
3+
coverage
34
example
45
src
56
tsconfig.json

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"build": "rm -rf lib && tsc",
2121
"watch": "tsc --watch",
2222
"prepack": "npm run build",
23-
"test": "node --experimental-vm-modules ./node_modules/.bin/jest --verbose"
23+
"test": "node --experimental-vm-modules ./node_modules/.bin/jest --verbose --coverage"
2424
},
2525
"devDependencies": {
2626
"@types/jest": "^29.0.3",

src/__test__/createConnectedInstances.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import subProcessIPCLoopback from './subProcessIPCLoopback'
22
import IPOS from '../main'
3-
import {withoutProcessSendSync} from './withoutProcessSendSync'
3+
import {withoutProcessSend} from './withoutProcessSend'
44

55
export default async function createConnectedInstances(): Promise<{ main_ipos: IPOS, sub_ipos: IPOS, sub_process: subProcessIPCLoopback }> {
66
const sub_process = new subProcessIPCLoopback()
77
let main_ipos: IPOS, sub_ipos: IPOS
8-
await withoutProcessSendSync(() => {
8+
await withoutProcessSend(() => {
99
main_ipos = IPOS.new() as IPOS
1010
})
1111

src/__test__/initialize.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import IPOS from '../main'
22
import subProcessIPCLoopback from './subProcessIPCLoopback'
3-
import {withoutProcessSendSync} from './withoutProcessSendSync'
3+
import {withoutProcessSend} from './withoutProcessSend'
44

55
describe('Initialising IPOS', () => {
66
it('Create new instance in a main process', () => {
77
// this is a subprocess anyway
88
// just simulate main process by setting process.send to undefined (jamming the subprocess detection)
9-
withoutProcessSendSync(() => {
9+
withoutProcessSend(() => {
1010
let ipos
1111
expect(() => ipos = IPOS.new()).not.toThrow()
1212
expect(ipos).toBeInstanceOf(IPOS)
@@ -33,7 +33,7 @@ describe('Initialising IPOS', () => {
3333

3434
const sub_ipos: Promise<IPOS> = IPOS.new() as Promise<IPOS>
3535
let main_ipos: IPOS
36-
withoutProcessSendSync(() => {
36+
withoutProcessSend(() => {
3737
main_ipos = IPOS.new() as IPOS
3838
})
3939

@@ -58,7 +58,7 @@ describe('Initialising IPOS', () => {
5858
const sub_process = new subProcessIPCLoopback()
5959

6060
let main_ipos: IPOS
61-
withoutProcessSendSync(() => {
61+
withoutProcessSend(() => {
6262
main_ipos = IPOS.new() as IPOS
6363
})
6464

src/__test__/synchronize.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import IPOS from '../main'
22

33
import subProcessIPCLoopback from './subProcessIPCLoopback'
4-
import {withoutProcessSendSync} from './withoutProcessSendSync'
4+
import {withoutProcessSend} from './withoutProcessSend'
55
import createFieldsTest from './runCreateFieldsTest'
66

77
describe('Synchronising fields', () =>
88
createFieldsTest(
99
async (setValue: (ipos_for_setting: IPOS) => void, probeValue: (ipos_for_probing: IPOS) => void) => {
1010
const sub_process = new subProcessIPCLoopback()
1111
let main_ipos: IPOS, sub_ipos: IPOS
12-
await withoutProcessSendSync(() => {
12+
await withoutProcessSend(() => {
1313
main_ipos = IPOS.new() as IPOS
1414
setValue(main_ipos)
1515
})

src/__test__/withoutProcessSend.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export function withoutProcessSend(callback: () => void) {
2+
const processSend = process.send
3+
process.send = undefined
4+
callback()
5+
process.send = processSend
6+
}

src/__test__/withoutProcessSendSync.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)