diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index f03d0a6..0fcd8c0 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -6,18 +6,25 @@ jobs: test: env: FORCE_COLOR: '1' - name: Build & Test - runs-on: ubuntu-latest + name: Build & Test (Node ${{ matrix.node-version }}, ${{ matrix.os }}) + runs-on: ${{ matrix.os }} strategy: matrix: - include: - - node-version: '22' - - node-version: '24' + os: [ubuntu-latest, windows-latest] + node-version: ['20', '22', '24'] + exclude: + - os: windows-latest + node-version: '20' steps: - name: Checkout Repository uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - uses: ./.github/actions/prepare with: node-version: ${{ matrix.node-version }} + - name: Test (Node v20.x) + if: matrix.node-version == '20' + # CAUTION: this only works in POSIX environments + run: npm run test:node20 - name: Test + if: matrix.node-version != '20' run: npm test diff --git a/package.json b/package.json index ce7faa3..02fb854 100644 --- a/package.json +++ b/package.json @@ -59,8 +59,10 @@ "lint:types": "tsc --noEmit", "prepare": "husky; run-s -s build", "test": "run-s test:runtime", - "test:runtime": "node --import tsx --test --test-reporter=spec \"test/**/*.test.ts\"", - "test:watch": "node --import tsx --test --test-reporter=spec --watch \"test/**/*.test.ts\"" + "test:base": "node --import tsx --test --test-reporter=spec", + "test:node20": "node --import tsx --test --test-reporter=spec test/*.test.ts", + "test:runtime": "npm run test:base -- \"test/*.test.ts\"", + "test:watch": "npm run test:base -- --watch \"test/*.test.ts\"" }, "devDependencies": { "@commitlint/cli": "20.2.0", diff --git a/test/osc.test.ts b/test/osc.test.ts index 9cdb3f4..1e6e943 100644 --- a/test/osc.test.ts +++ b/test/osc.test.ts @@ -80,35 +80,47 @@ describe('osc', () => { expect(supportsHyperlinks(), 'to be', false); }); - it('should return false for VTE 0.50.0 (dotted format) due to segfault bug', () => { - delete process.env.CI; - delete process.env.FORCE_HYPERLINK; - delete process.env.TERM_PROGRAM; - process.env.VTE_VERSION = '0.50.0'; - - const mockStream = { isTTY: true } as NodeJS.WriteStream; - expect(supportsHyperlinks(mockStream), 'to be', false); - }); - - it('should return false for VTE 0.50.0 (compact format "5000") due to segfault bug', () => { - delete process.env.CI; - delete process.env.FORCE_HYPERLINK; - delete process.env.TERM_PROGRAM; - process.env.VTE_VERSION = '5000'; - - const mockStream = { isTTY: true } as NodeJS.WriteStream; - expect(supportsHyperlinks(mockStream), 'to be', false); - }); + it( + 'should return false for VTE 0.50.0 (dotted format) due to segfault bug', + { skip: process.platform === 'win32' }, + () => { + delete process.env.CI; + delete process.env.FORCE_HYPERLINK; + delete process.env.TERM_PROGRAM; + process.env.VTE_VERSION = '0.50.0'; + + const mockStream = { isTTY: true } as NodeJS.WriteStream; + expect(supportsHyperlinks(mockStream), 'to be', false); + }, + ); - it('should return true for VTE 0.50.1 (compact format "5001")', () => { - delete process.env.CI; - delete process.env.FORCE_HYPERLINK; - delete process.env.TERM_PROGRAM; - process.env.VTE_VERSION = '5001'; + it( + 'should return false for VTE 0.50.0 (compact format "5000") due to segfault bug', + { skip: process.platform === 'win32' }, + () => { + delete process.env.CI; + delete process.env.FORCE_HYPERLINK; + delete process.env.TERM_PROGRAM; + process.env.VTE_VERSION = '5000'; + + const mockStream = { isTTY: true } as NodeJS.WriteStream; + expect(supportsHyperlinks(mockStream), 'to be', false); + }, + ); - const mockStream = { isTTY: true } as NodeJS.WriteStream; - expect(supportsHyperlinks(mockStream), 'to be', true); - }); + it( + 'should return true for VTE 0.50.1 (compact format "5001")', + { skip: process.platform === 'win32' }, + () => { + delete process.env.CI; + delete process.env.FORCE_HYPERLINK; + delete process.env.TERM_PROGRAM; + process.env.VTE_VERSION = '5001'; + + const mockStream = { isTTY: true } as NodeJS.WriteStream; + expect(supportsHyperlinks(mockStream), 'to be', true); + }, + ); }); describe('linkifyUrls()', () => {