diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml new file mode 100644 index 0000000..54fd5d3 --- /dev/null +++ b/.github/workflows/continuous-integration.yml @@ -0,0 +1,53 @@ +name: Continuous Integration +on: + # branches pushed by collaborators + push: + branches: + - master + # pull request from non-collaborators + pull_request: {} + # nightly + schedule: + - cron: '0 0 * * *' +jobs: + build: + name: "Test: ${{ matrix.os }}, node ${{ matrix.node }}" + runs-on: ${{ matrix.os }}-latest + strategy: + fail-fast: false + matrix: + os: [ubuntu, windows] + node: + - 16 + - 14 + - 12 + - 10 + - 9 + - '8' + - '7' + - '6' + - '4' + - '0.12' + # - '0.10' + steps: + # checkout code + - uses: actions/checkout@v2 + # install node + - name: Use Node.js ${{ matrix.os }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + + # npm install with caching + - run: | + npm config set cache "$( node -p "process.cwd()" )/temp/npm-cache" + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: temp/npm-cache + key: npm-cache-${{ matrix.os }} ${{ matrix.node }}-${{ hashFiles('package-lock.json') }} + # restore-keys: npm-cache-${{ matrix.os }} ${{ matrix.node }}- + - run: npm install + + # Run tests + - run: npm test diff --git a/package-lock.json b/package-lock.json index bbaceca..2bbbd23 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1025,12 +1025,6 @@ "integrity": "sha1-gVHTWOIMisx/t0XnRywAJf5JZXA=", "dev": true }, - "eventemitter3": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.0.tgz", - "integrity": "sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA==", - "dev": true - }, "events": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/events/-/events-1.0.2.tgz", @@ -1821,14 +1815,22 @@ } }, "http-proxy": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.17.0.tgz", - "integrity": "sha512-Taqn+3nNvYRfJ3bGvKfBSRwy1v6eePlm3oc/aWVxZp57DQr5Eq3xhKJi7Z4hZpS8PC3H4qI+Yly5EmFacGuA/g==", + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", + "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", "dev": true, "requires": { - "eventemitter3": "^3.0.0", + "eventemitter3": "^4.0.0", "follow-redirects": "^1.0.0", "requires-port": "^1.0.0" + }, + "dependencies": { + "eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "dev": true + } } }, "http-server": { diff --git a/test.js b/test.js index ef7ad55..8fb0a62 100644 --- a/test.js +++ b/test.js @@ -86,7 +86,7 @@ function createMultiLineSourceMapWithSourcesContent() { function compareStackTrace(sourceMap, source, expected) { // Check once with a separate source map - fs.writeFileSync('.generated.js.map', sourceMap); + fs.writeFileSync('.generated.js.map', sourceMap.toString()); fs.writeFileSync('.generated.js', 'exports.test = function() {' + source.join('\n') + '};//@ sourceMappingURL=.generated.js.map'); try { @@ -113,7 +113,7 @@ function compareStackTrace(sourceMap, source, expected) { function compareStdout(done, sourceMap, source, expected) { fs.writeFileSync('.original.js', 'this is the original code'); - fs.writeFileSync('.generated.js.map', sourceMap); + fs.writeFileSync('.generated.js.map', sourceMap.toString()); fs.writeFileSync('.generated.js', source.join('\n') + '//@ sourceMappingURL=.generated.js.map'); child_process.exec('node ./.generated', function(error, stdout, stderr) { @@ -616,7 +616,7 @@ it('handleUncaughtExceptions is true with existing listener', function(done) { ]; fs.writeFileSync('.original.js', 'this is the original code'); - fs.writeFileSync('.generated.js.map', createSingleLineSourceMap()); + fs.writeFileSync('.generated.js.map', createSingleLineSourceMap().toString()); fs.writeFileSync('.generated.js', source.join('\n')); child_process.exec('node ./.generated', function(error, stdout, stderr) {