Skip to content

Commit

Permalink
Improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed Jan 25, 2020
1 parent 48c74c2 commit b8a0fea
Show file tree
Hide file tree
Showing 14 changed files with 36 additions and 31 deletions.
2 changes: 1 addition & 1 deletion cli/run/index.ts
Expand Up @@ -16,7 +16,7 @@ export default function runRollup(command: any) {
if (command.input) {
handleError({
code: 'DUPLICATE_IMPORT_OPTIONS',
message: 'use --input, or pass input path as argument'
message: 'Either use --input, or pass input path as argument'
});
}
inputSource = command._;
Expand Down
11 changes: 0 additions & 11 deletions test/cli/node_modules/rollup-config-foo/lib/config.js

This file was deleted.

3 changes: 0 additions & 3 deletions test/cli/node_modules/rollup-config-foo/package.json

This file was deleted.

File renamed without changes.
File renamed without changes.
11 changes: 0 additions & 11 deletions test/cli/node_modules_rename_me/foo/lib/config.js

This file was deleted.

3 changes: 0 additions & 3 deletions test/cli/node_modules_rename_me/foo/package.json

This file was deleted.

10 changes: 10 additions & 0 deletions test/cli/samples/duplicate-import-options/_config.js
@@ -0,0 +1,10 @@
const { assertStderrIncludes } = require('../../../utils.js');

module.exports = {
description: 'throws if different types of entries are combined',
command: 'rollup main.js --format es --input main.js',
error: () => true,
stderr(stderr) {
assertStderrIncludes(stderr, '[!] Either use --input, or pass input path as argument');
}
};
1 change: 1 addition & 0 deletions test/cli/samples/duplicate-import-options/main.js
@@ -0,0 +1 @@
assert.equal( 1 + 1, 2 );
2 changes: 1 addition & 1 deletion test/cli/samples/node-config-auto-prefix/_config.js
@@ -1,5 +1,5 @@
module.exports = {
description: 'uses config file installed from npm',
description: 'uses config file installed from npm, automatically adding a rollup-config- prefix',
command: 'rollup --config node:foo',
execute: true
};
10 changes: 10 additions & 0 deletions test/cli/samples/node-config-not-found/_config.js
@@ -0,0 +1,10 @@
const { assertStderrIncludes } = require('../../../utils.js');

module.exports = {
description: 'throws if a config in node_modules cannot be found',
command: 'rollup --config node:baz',
error: () => true,
stderr(stderr) {
assertStderrIncludes(stderr, '[!] Could not resolve config file node:baz');
}
};
11 changes: 11 additions & 0 deletions test/cli/samples/node-config-not-found/_expected.js
@@ -0,0 +1,11 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
global.myBundle = factory();
}(this, function () { 'use strict';

var main = 42;

return main;

}));
1 change: 1 addition & 0 deletions test/cli/samples/node-config-not-found/main.js
@@ -0,0 +1 @@
assert.equal( ANSWER, 42 );
2 changes: 1 addition & 1 deletion test/cli/samples/node-config/_config.js
@@ -1,6 +1,6 @@
module.exports = {
description: 'uses config file installed from npm',
command: 'rollup --config node:foo',
command: 'rollup --config node:bar',
cwd: __dirname,
execute: true
};

0 comments on commit b8a0fea

Please sign in to comment.