Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish

on:
workflow_dispatch:
inputs:
npm-tag:
description: 'NPM tag to publish the package (e.g., latest, beta, etc.)'
required: false
default: 'latest'
type: string
dry-run:
description: 'Perform a dry run (true/false)'
required: false
default: false
type: boolean

jobs:
publish:
uses: WJSoftware/cicd/.github/workflows/[email protected]
with:
node-version: 24
build-script: build
test-script: test
npm-tag: ${{ inputs.npm-tag || 'latest' }}
dry-run: ${{ inputs.dry-run || false }}
secrets: inherit
14 changes: 14 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Unit Testing

on:
pull_request:
branches: [ main ]

jobs:
test:
uses: WJSoftware/cicd/.github/workflows/[email protected]
with:
node-version: 24
build-script: build
test-script: test
build: true
3 changes: 2 additions & 1 deletion tests/ut/sync/AutoResetEvent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { expect } from 'chai';
import { sinon } from '../../setup.js';
import { AutoResetEvent } from '../../../src/sync/AutoResetEvent.js';
import { autoResetEventIdentityData } from '../../../src/sync/identifiers.js';
import { testAutoResetEventWaitInWorker } from '../helpers/helpers.js';
import { delay, testAutoResetEventWaitInWorker } from '../helpers/helpers.js';
import { ManualResetEvent } from '../../../src/sync/ManualResetEvent.js';

describe('AutoResetEvent', () => {
Expand Down Expand Up @@ -87,6 +87,7 @@ describe('AutoResetEvent', () => {
it('Should wait and succeed when signal becomes available.', async () => {
const waitComplete = (await testAutoResetEventWaitInWorker(eventObj.token, 1000)).wait;

await delay(50); // Ensure the worker is waiting
eventObj.signal();

const result = await waitComplete;
Expand Down
3 changes: 2 additions & 1 deletion tests/ut/sync/ManualResetEvent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { describe, it, beforeEach } from 'mocha';
import { expect } from 'chai';
import { sinon } from '../../setup.js';
import { ManualResetEvent } from '../../../src/sync/ManualResetEvent.js';
import { testManualResetEventWaitInWorker, tokenTypeTest } from '../helpers/helpers.js';
import { delay, testManualResetEventWaitInWorker, tokenTypeTest } from '../helpers/helpers.js';
import { manualResetEventIdentityData } from '../../../src/sync/identifiers.js';
import { AutoResetEvent } from '../../../src/sync/AutoResetEvent.js';

Expand Down Expand Up @@ -80,6 +80,7 @@ describe('ManualResetEvent', () => {
it('Should wait and succeed when signal becomes available.', async () => {
const waitComplete = (await testManualResetEventWaitInWorker(eventObj.token, 1000)).wait;

await delay(50); // Ensure the worker is waiting
eventObj.signal();

const result = await waitComplete;
Expand Down