Skip to content

Commit

Permalink
chore: explicit peerDependencies on rollup ^1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mjeanroy committed Mar 22, 2020
1 parent 5f21686 commit bc251bd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
10 changes: 9 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
{
"presets": [
"@babel/preset-env"
[
"@babel/preset-env", {
"modules": "cjs",
"targets": {
"node": "6"
}
}
]

],

"plugins": [
Expand Down
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
"rollup",
"rollup-plugin"
],
"peerDependencies": {
"rollup": "^1.0.0"
},
"devDependencies": {
"@babel/core": "7.9.0",
"@babel/preset-env": "7.9.0",
Expand All @@ -52,5 +55,8 @@
"rimraf": "3.0.2",
"rollup": "1.32.0",
"tmp": "0.1.0"
},
"engines": {
"node": ">=6.0.0"
}
}
15 changes: 2 additions & 13 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import plugin from '../src/index.js';
import {joinLines} from './utils/join-lines';

describe('rollup-plugin-strip-banner', () => {
it('should strip banner and generate sourceMap by default', () => {
it('should strip banner and generate sourcemap', () => {
const instance = plugin();
const id = 'test-file.js';
const code = fs.readFileSync(path.join(__dirname, 'fixtures', id), 'utf-8');
Expand All @@ -47,44 +47,33 @@ describe('rollup-plugin-strip-banner', () => {

it('should ignore source if it is does not have banner', () => {
const id = 'test-file-without-banner.js';

const instance = plugin({
sourceMap: false,
});

const instance = plugin();
const code = fs.readFileSync(path.join(__dirname, 'fixtures', id), 'utf-8');

const result = instance.transform(code, id);

expect(result).not.toBeDefined();
});

it('should ignore source if it is not included', () => {
const id = 'test-file.js';

const instance = plugin({
sourceMap: false,
include: '**/*.spec.js',
});

const code = fs.readFileSync(path.join(__dirname, 'fixtures', id), 'utf-8');

const result = instance.transform(code, id);

expect(result).not.toBeDefined();
});

it('should ignore source if it is excluded', () => {
const id = 'test-file.js';

const instance = plugin({
sourceMap: false,
include: '**/*test*.js',
exclude: id,
});

const code = fs.readFileSync(path.join(__dirname, 'fixtures', id), 'utf-8');

const result = instance.transform(code, id);

expect(result).not.toBeDefined();
Expand Down

0 comments on commit bc251bd

Please sign in to comment.