Skip to content

Commit

Permalink
Add tests for rollup#183
Browse files Browse the repository at this point in the history
  • Loading branch information
allex committed Oct 19, 2018
1 parent cc16868 commit 9cc8b43
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 0 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions test/node_modules/isomorphic-object-with-false/lib/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions test/node_modules/isomorphic-object-with-false/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions test/samples/browser-object-with-false/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Client from 'isomorphic-object-with-false';
import HTTPTracker from 'isomorphic-object-with-false/lib/client/http-tracker';
import ES6_BROWSER_EMPTY from '../../../src/empty';

// do some assert

assert.deepEqual(new Client('ws:'), { name: 'websocket-tracker' })
assert.deepEqual(new Client('http:'), { name: 'NULL' })
assert.equal(HTTPTracker, ES6_BROWSER_EMPTY);


// expose
export default "ok"
12 changes: 12 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -626,4 +626,16 @@ describe( 'rollup-plugin-node-resolve', function () {
assert.deepEqual( bundle.imports, [ 'foo/deep' ] );
});
});

it( 'pkg.browser with mapping to prevent bundle by specifying a value of false', () => {
return rollup.rollup({
input: 'samples/browser-object-with-false/main.js',
plugins: [
nodeResolve({ browser: true }),
commonjs()
]
}).then( executeBundle ).then( module => {
assert.equal( module.exports, 'ok' );
});
});
});

0 comments on commit 9cc8b43

Please sign in to comment.