Skip to content

Commit 063040e

Browse files
committed
Inline test source content.
1 parent b326cdd commit 063040e

3 files changed

Lines changed: 15 additions & 22 deletions

File tree

.eslintrc.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,5 @@ module.exports = {
2222
jest: true,
2323
},
2424
},
25-
{
26-
files: ['fixtures/**/*.js'],
27-
parserOptions: {
28-
sourceType: 'module',
29-
},
30-
},
3125
],
3226
};

__tests__/index-test.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,10 +424,22 @@ describe('when used with typescript', () => {
424424
});
425425

426426
describe('when used with babel-plugin-istanbul', () => {
427-
it('throws an exception', () => {
427+
// babel-plugin-istanbul won't run on <= Node 6
428+
const majorVersion = parseInt(process.version.match(/^v(\d+)\./)[1], 10);
429+
const runOrSkip = majorVersion > 6 ? it : it.skip;
430+
431+
runOrSkip('throws an exception', () => {
432+
let source = `
433+
import EmberObject from '@ember/object';
434+
import Evented from '@ember/object/evented';
435+
436+
export default class TestObject extends EmberObject.extend(Evented) {};
437+
`;
438+
428439
expect(() => {
429-
babel7.transformFileSync('./fixtures/istanbul-should-cover.js', {
430-
plugins: [[require('babel-plugin-istanbul')], Plugin],
440+
babel7.transformSync(source, {
441+
filename: 'istanbul-should-cover.js',
442+
plugins: [require('babel-plugin-istanbul'), Plugin],
431443
});
432444
}).toThrow(/Container is falsy/i);
433445
});

fixtures/istanbul-should-cover.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)