Skip to content

Instantly share code, notes, and snippets.

@ingorichter
Created March 17, 2014 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ingorichter/9604564 to your computer and use it in GitHub Desktop.
Save ingorichter/9604564 to your computer and use it in GitHub Desktop.
it("should show only warnings for the current file", function () {
CodeInspection.toggleEnabled(false);
var deferred = new $.Deferred();
var asyncProvider = {
name: "Test Async Linter",
scanFileAsync: function () {
return deferred.promise();
}
};
CodeInspection.register("javascript", asyncProvider);
waitsForDone(SpecRunnerUtils.openProjectFiles(["no-errors.js", "errors.js"], "open test files"));
runs(function () {
CodeInspection.toggleEnabled(true);
});
// Close the file which was started to lint
runs(function () {
waitsForDone(CommandManager.execute(Commands.FILE_CLOSE), "timeout on FILE_CLOSE", 1000);
// let the linter finish
deferred.resolve(failLintResult());
expect($("#problems-panel").is(":visible")).toBe(false);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment