Skip to content

Commit 4fc8431

Browse files
committed
fixed test
1 parent 23b2476 commit 4fc8431

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

‎test/resolve.js‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,24 @@ var resolve = require("../lib/resolve");
99
var fixtures = path.join(__dirname, "fixtures");
1010
function testResolve(name, context, moduleName, result) {
1111
describe(name, function() {
12-
it("should resolve correctly", function() {
12+
it("should resolve correctly", function(done) {
1313
resolve(context, moduleName, {}, function(err, filename) {
14-
should.not.exist(err);
14+
if(err) done(err);
1515
should.exist(filename);
1616
filename.should.equal(result);
17+
done();
1718
});
1819
});
1920
});
2021
}
2122
function testResolveContext(name, context, moduleName, result) {
2223
describe(name, function() {
23-
it("should resolve correctly", function() {
24+
it("should resolve correctly", function(done) {
2425
resolve.context(context, moduleName, {}, function(err, filename) {
25-
should.not.exist(err);
26+
if(err) done(err);
2627
should.exist(filename)
2728
filename.should.equal(result);
29+
done();
2830
});
2931
});
3032
});
@@ -56,7 +58,7 @@ describe("resolve", function() {
5658
testResolve("multiple loaders",
5759
fixtures, "m1/a!m1/b!m2/b!./main1.js", path.join(fixtures, "node_modules", "m1", "a.js") + "!" +
5860
path.join(fixtures, "node_modules", "m1", "b.js") + "!" +
59-
path.join(fixtures, "node_modules", "m2", "b.js") + "!" +
61+
path.join(fixtures, "node_modules", "m2-loader", "b.js") + "!" +
6062
path.join(fixtures, "main1.js"));
6163

6264
testResolveContext("context for fixtures",
@@ -67,6 +69,6 @@ describe("resolve", function() {
6769
fixtures, "m1/a!./", path.join(fixtures, "node_modules", "m1", "a.js") + "!" + fixtures);
6870
testResolveContext("context with loaders in parent directory",
6971
fixtures, "m1/a!m2/b.js!../", path.join(fixtures, "node_modules", "m1", "a.js") + "!" +
70-
path.join(fixtures, "node_modules", "m1", "a.js") + "!" +
72+
path.join(fixtures, "node_modules", "m2-loader", "b.js") + "!" +
7173
path.join(fixtures, ".."));
7274
});

0 commit comments

Comments
 (0)