Skip to content

Commit

Permalink
Failing test case for rollup circular dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
voodooattack committed Nov 12, 2016
1 parent 372bca9 commit 317bea8
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@
"pretty-bytes": "^4.0.0",
"remap-istanbul": "^0.5.1",
"request": "^2.75.0",
"rollup": "^0.36.3",
"rollup-plugin-commonjs": "^5.0.5",
"rollup-plugin-node-resolve": "^2.0.0",
"rxjs": "^5.0.0-beta.11",
"sinon": "^1.17.4",
"source-map-support": "^0.4.0",
Expand Down
5 changes: 5 additions & 0 deletions test/bundle/bundleTest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { QueryManager } from '../../lib/src/core/QueryManager.js';
import { ObservableQuery } from '../../lib/src/core/ObservableQuery.js';

if (!QueryManager && !ObservableQuery)
throw new Error('Circular dependency detected!');
32 changes: 32 additions & 0 deletions test/rollupBundle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// import { assert } from 'chai';
import { join } from 'path';

/* tslint:disable */
declare function require(name: string): any;
const rollup: any = require('rollup');
const resolve: any = require('rollup-plugin-node-resolve');
const commonjs: any = require('rollup-plugin-commonjs');
/* tslint:enable */

describe('rollup bundle', () => {
it('can be created', (done) => {
rollup.rollup({
entry: join(__dirname, '../../test/bundle/bundleTest.js'),
onwarn: () => false,
context: 'global',
plugins: [ resolve(), commonjs({ include: ['node_modules/**', 'lib/**'] }) ],
}).then((bundle: any) => {
return bundle.write({
// output format - 'amd', 'cjs', 'es', 'iife', 'umd'
format: 'iife',
dest: join(__dirname, './bundle/bundleTestOut.js'),
});
}).then(() => done())
.catch(done);
});
it('can be evaluated', () => {
/* tslint:disable */
require(join(__dirname, './bundle/bundleTestOut.js'));
/* tslint:enable */
});
});
1 change: 1 addition & 0 deletions test/tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ import './graphqlSubscriptions';
import './batchedNetworkInterface';
import './ObservableQuery';
import './subscribeToMore';
import './rollupBundle';

0 comments on commit 317bea8

Please sign in to comment.