diff --git a/.github/workflows/verify-build.yaml b/.github/workflows/verify-build.yaml index 069592a..e366996 100644 --- a/.github/workflows/verify-build.yaml +++ b/.github/workflows/verify-build.yaml @@ -64,5 +64,5 @@ jobs: - name: Lint run: npm run lint - name: Test - run: npm run test + run: npm run test:ci diff --git a/package.json b/package.json index c037594..f28edc2 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "preversion": "yarn install && npm run generate", "postversion": "cargo bump $npm_package_version && git commit -am \"v$npm_package_version\" && node .scripts/check-changelog.mjs", "test": "mocha tests/*.spec.mjs", + "test:ci": "mocha tests/*.spec.mjs -- --ci", "test:only": "mocha", "wpt": "npm run build && node ./.scripts/wpt-harness.mjs", "wpt:only": "node ./.scripts/wpt-harness.mjs" diff --git a/tests/getUserMedia.spec.mjs b/tests/getUserMedia.spec.mjs index 97a0faa..1a6f2d2 100644 --- a/tests/getUserMedia.spec.mjs +++ b/tests/getUserMedia.spec.mjs @@ -3,6 +3,8 @@ import { sleep } from '@ircam/sc-utils'; import { mediaDevices, AudioContext, MediaStreamAudioSourceNode } from '../index.mjs'; +const CI = process.argv.includes('--ci'); + describe('# mediaDevices.getUserMedia(options)', () => { it('should fail if no argument given', async () => { let failed = false; @@ -48,6 +50,12 @@ describe('# mediaDevices.getUserMedia(options)', () => { }); it('should not fail if options.audio = true', async () => { + // accessing microphone in CI make the process stuck + if (CI) { + console.log('Run in CI, aborting...'); + return; + } + let failed = false; const audioContext = new AudioContext(); @@ -67,6 +75,12 @@ describe('# mediaDevices.getUserMedia(options)', () => { }); it('should work with MediaStreamAudioSourceNode [1 factory] (make some noise)', async () => { + // accessing microphone in CI make the process stuck + if (CI) { + console.log('Run in CI, aborting...'); + return; + } + let failed = false; const audioContext = new AudioContext(); @@ -89,6 +103,12 @@ describe('# mediaDevices.getUserMedia(options)', () => { }); it('should work with MediaStreamAudioSourceNode [2 ctor] (make some noise)', async () => { + // accessing microphone in CI make the process stuck + if (CI) { + console.log('Run in CI, aborting...'); + return; + } + let failed = false; const audioContext = new AudioContext();