Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds test showing ES6 circular dependencies working with Babel #535

Merged
merged 1 commit into from
Oct 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions test/circular/bar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { getBar, name as fooName } from './foo';

export let name = 'bar';

export function getFoo() {
return fooName;
}
3 changes: 3 additions & 0 deletions test/circular/dev.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<script src="../../bower_components/steal/steal.js"
base-url="./"
config="package.json!npm"></script>
7 changes: 7 additions & 0 deletions test/circular/foo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { getFoo, name as barName } from './bar';

export let name = 'foo';

export function getBar() {
return barName;
}
6 changes: 6 additions & 0 deletions test/circular/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { getBar } from './foo';
import { getFoo } from './bar';

// true in dev, false in production
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean with that comment?
In the multibuild_test you check against true in prod.html

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment was old, when this was breaking it was true in dev and false in prod. It's working now, just forgot to remove the comment.

window.circularWorks = (getBar() === 'bar') &&
(getFoo() === 'foo');
8 changes: 8 additions & 0 deletions test/circular/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "circular",
"main": "main.js",
"version": "1.0.0",
"system": {
"transpiler": "babel"
}
}
5 changes: 5 additions & 0 deletions test/circular/prod.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<script src="../../bower_components/steal/steal.js"
base-url="./"
config="package.json!npm"
main="circular/main"
env="production"></script>
21 changes: 21 additions & 0 deletions test/multibuild_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,28 @@ describe("multi build", function(){
});
});

it("Circular refs works with Babel", function(done){
rmdir(__dirname+"/circular/dist", function(error){
if(error){
done(error);
return;
}

multiBuild({
config: __dirname+"/circular/package.json!npm",
}, {
quiet: true,
minify: false
}).then(function(){
open("test/circular/prod.html",function(browser, close){
find(browser,"circularWorks", function(result){
assert.equal(result, true, "circular refs worked");
close();
}, close);
}, done);
}, done);
});
});

describe("with plugins", function(){
this.timeout(60000);
Expand Down