Skip to content

Commit

Permalink
fix compile callback (#208)
Browse files Browse the repository at this point in the history
* fix compile callback

* test
  • Loading branch information
DevSide committed Nov 6, 2016
1 parent 443c01e commit 13a3f8a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ exports.compile = function (file, options, cb) {
options = {};
} else {
options = options || {};
cb = null;
}
if (extd.isString(file)) {
options.name = options.name || (isNoolsFile(file) ? path.basename(file, path.extname(file)) : null);
Expand Down
13 changes: 13 additions & 0 deletions test/issues.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,4 +289,17 @@ it.describe("issues", function (it) {
myLine.addPoint(5, 5);
});
});

it.describe("127", function (it) {
var flow, callbackCalled;
it.beforeAll(function () {
flow = nools.compile("", {name: "issue127"}, function() {
callbackCalled = true;
});
});

it.should("callback should be called even if config provided", function () {
assert.truthy(callbackCalled);
});
});
});

0 comments on commit 13a3f8a

Please sign in to comment.