Skip to content

Commit e5b708a

Browse files
authored
Merge pull request #1 from cspotcode/ab/ci
CI
2 parents d058745 + 98ac22f commit e5b708a

File tree

2 files changed

+56
-3
lines changed

2 files changed

+56
-3
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Continuous Integration
2+
on:
3+
# branches pushed by collaborators
4+
push:
5+
branches:
6+
- master
7+
# pull request from non-collaborators
8+
pull_request: {}
9+
# nightly
10+
schedule:
11+
- cron: '0 0 * * *'
12+
jobs:
13+
build:
14+
name: "Test: ${{ matrix.os }}, node ${{ matrix.node }}"
15+
runs-on: ${{ matrix.os }}-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [ubuntu, windows]
20+
node:
21+
- 16
22+
- 14
23+
- 12
24+
- 10
25+
- 9
26+
- '8'
27+
- '7'
28+
- '6'
29+
- '4'
30+
- '0.12'
31+
# - '0.10'
32+
steps:
33+
# checkout code
34+
- uses: actions/checkout@v2
35+
# install node
36+
- name: Use Node.js ${{ matrix.os }}
37+
uses: actions/setup-node@v1
38+
with:
39+
node-version: ${{ matrix.node }}
40+
41+
# npm install with caching
42+
- run: |
43+
npm config set cache "$( node -p "process.cwd()" )/temp/npm-cache"
44+
- name: Cache dependencies
45+
uses: actions/cache@v2
46+
with:
47+
path: temp/npm-cache
48+
key: npm-cache-${{ matrix.os }} ${{ matrix.node }}-${{ hashFiles('package-lock.json') }}
49+
# restore-keys: npm-cache-${{ matrix.os }} ${{ matrix.node }}-
50+
- run: npm install
51+
52+
# Run tests
53+
- run: npm test

test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function createMultiLineSourceMapWithSourcesContent() {
8686

8787
function compareStackTrace(sourceMap, source, expected) {
8888
// Check once with a separate source map
89-
fs.writeFileSync('.generated.js.map', sourceMap);
89+
fs.writeFileSync('.generated.js.map', sourceMap.toString());
9090
fs.writeFileSync('.generated.js', 'exports.test = function() {' +
9191
source.join('\n') + '};//@ sourceMappingURL=.generated.js.map');
9292
try {
@@ -113,7 +113,7 @@ function compareStackTrace(sourceMap, source, expected) {
113113

114114
function compareStdout(done, sourceMap, source, expected) {
115115
fs.writeFileSync('.original.js', 'this is the original code');
116-
fs.writeFileSync('.generated.js.map', sourceMap);
116+
fs.writeFileSync('.generated.js.map', sourceMap.toString());
117117
fs.writeFileSync('.generated.js', source.join('\n') +
118118
'//@ sourceMappingURL=.generated.js.map');
119119
child_process.exec('node ./.generated', function(error, stdout, stderr) {
@@ -616,7 +616,7 @@ it('handleUncaughtExceptions is true with existing listener', function(done) {
616616
];
617617

618618
fs.writeFileSync('.original.js', 'this is the original code');
619-
fs.writeFileSync('.generated.js.map', createSingleLineSourceMap());
619+
fs.writeFileSync('.generated.js.map', createSingleLineSourceMap().toString());
620620
fs.writeFileSync('.generated.js', source.join('\n'));
621621

622622
child_process.exec('node ./.generated', function(error, stdout, stderr) {

0 commit comments

Comments
 (0)