Skip to content
This repository was archived by the owner on Aug 4, 2021. It is now read-only.

Commit 29cfe83

Browse files
authored
Make tests run with Node 6 again and update dependencies (#389)
1 parent a2f3ff4 commit 29cfe83

File tree

5 files changed

+48
-58
lines changed

5 files changed

+48
-58
lines changed

.babelrc.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
presets: [
3+
[
4+
'@babel/preset-env',
5+
{
6+
targets: {
7+
node: 6
8+
}
9+
}
10+
]
11+
]
12+
};

package-lock.json

+17-32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"estree-walker": "^0.6.0",
2929
"is-reference": "^1.1.2",
3030
"magic-string": "^0.25.2",
31-
"resolve": "^1.10.1",
31+
"resolve": "^1.11.0",
3232
"rollup-pluginutils": "^2.7.0"
3333
},
3434
"devDependencies": {
@@ -47,9 +47,9 @@
4747
"rollup": "^1.12.0",
4848
"rollup-plugin-babel": "^4.3.2",
4949
"rollup-plugin-json": "^4.0.0",
50-
"rollup-plugin-node-resolve": "^4.2.4",
50+
"rollup-plugin-node-resolve": "^5.0.0",
5151
"shx": "^0.3.2",
52-
"source-map": "^0.7.3",
52+
"source-map": "^0.6.1",
5353
"source-map-support": "^0.5.12",
5454
"typescript": "^3.4.5"
5555
},

rollup.config.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,9 @@ export default {
66
input: 'src/index.js',
77
plugins: [
88
json(),
9-
babel({
10-
presets: [['@babel/preset-env', {
11-
targets: {
12-
node: 6
13-
}
14-
}]]
15-
})
9+
babel()
1610
],
17-
external: Object.keys( pkg.dependencies ).concat([ 'fs', 'path' ]),
11+
external: Object.keys(pkg.dependencies).concat(['fs', 'path']),
1812
output: [
1913
{
2014
format: 'es',

test/test.js

+14-15
Original file line numberDiff line numberDiff line change
@@ -165,21 +165,20 @@ describe('rollup-plugin-commonjs', () => {
165165
})
166166
);
167167

168-
await SourceMapConsumer.with(map, null, async smc => {
169-
const locator = getLocator(code, { offsetLine: 1 });
170-
171-
let generatedLoc = locator('42');
172-
let loc = smc.originalPositionFor(generatedLoc); // 42
173-
assert.equal(loc.source, 'samples/sourcemap/foo.js');
174-
assert.equal(loc.line, 1);
175-
assert.equal(loc.column, 15);
176-
177-
generatedLoc = locator('log');
178-
loc = smc.originalPositionFor(generatedLoc); // log
179-
assert.equal(loc.source, 'samples/sourcemap/main.js');
180-
assert.equal(loc.line, 2);
181-
assert.equal(loc.column, 8);
182-
});
168+
const smc = new SourceMapConsumer(map);
169+
const locator = getLocator(code, { offsetLine: 1 });
170+
171+
let generatedLoc = locator('42');
172+
let loc = smc.originalPositionFor(generatedLoc); // 42
173+
assert.equal(loc.source, 'samples/sourcemap/foo.js');
174+
assert.equal(loc.line, 1);
175+
assert.equal(loc.column, 15);
176+
177+
generatedLoc = locator('log');
178+
loc = smc.originalPositionFor(generatedLoc); // log
179+
assert.equal(loc.source, 'samples/sourcemap/main.js');
180+
assert.equal(loc.line, 2);
181+
assert.equal(loc.column, 8);
183182
});
184183

185184
it('supports an array of multiple entry points', async () => {

0 commit comments

Comments
 (0)