Skip to content

Commit ad2e527

Browse files
devvaannshabose
authored andcommitted
feat: jshint integ tests failing when run individually
1 parent 80bb728 commit ad2e527

1 file changed

Lines changed: 25 additions & 1 deletion

File tree

test/spec/Extn-JSHint-integ-test.js

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ define(function (require, exports, module) {
3030
let testProjectsFolder = SpecRunnerUtils.getTestPath("/spec/JSHintExtensionTest-files/"),
3131
testWindow,
3232
$,
33-
CodeInspection;
33+
CodeInspection,
34+
CommandManager,
35+
Commands;
3436

3537
var toggleJSLintResults = function () {
3638
$("#status-inspection").triggerHandler("click");
@@ -41,6 +43,8 @@ define(function (require, exports, module) {
4143
// Load module instances from brackets.test
4244
$ = testWindow.$;
4345
CodeInspection = testWindow.brackets.test.CodeInspection;
46+
CommandManager = testWindow.brackets.test.CommandManager;
47+
Commands = testWindow.brackets.test.Commands;
4448
CodeInspection.toggleEnabled(true);
4549
await awaitsFor(()=>testWindow._JsHintExtensionReadyToIntegTest,
4650
"JsHint extension to be loaded", 10000);
@@ -49,12 +53,20 @@ define(function (require, exports, module) {
4953
afterAll(async function () {
5054
testWindow = null;
5155
$ = null;
56+
CommandManager = null;
57+
Commands = null;
5258
await SpecRunnerUtils.closeTestWindow();
5359
}, 30000);
5460

5561
it("status icon should toggle Errors panel when errors present", async function () {
5662
await SpecRunnerUtils.loadProjectInTestWindow(testProjectsFolder + "valid-config-error");
5763
await awaitsForDone(SpecRunnerUtils.openProjectFiles(["es8.js"]), "open test file with error");
64+
await awaitsFor(()=>{
65+
return $("#status-inspection").hasClass("inspection-errors");
66+
}, "Lint errors to be detected");
67+
if (!$("#problems-panel").is(":visible")) {
68+
CommandManager.execute(Commands.VIEW_TOGGLE_PROBLEMS);
69+
}
5870
await awaitsFor(()=>{
5971
return $("#problems-panel").is(":visible");
6072
}, "Problems panel to be visible");
@@ -73,6 +85,12 @@ define(function (require, exports, module) {
7385
it("should show errors if invalid .jshintrc detected", async function () {
7486
await SpecRunnerUtils.loadProjectInTestWindow(testProjectsFolder + "invalid-config");
7587
await awaitsForDone(SpecRunnerUtils.openProjectFiles(["no-errors.js"]), "open test file");
88+
await awaitsFor(()=>{
89+
return $("#status-inspection").hasClass("inspection-errors");
90+
}, "Lint errors to be detected");
91+
if (!$("#problems-panel").is(":visible")) {
92+
CommandManager.execute(Commands.VIEW_TOGGLE_PROBLEMS);
93+
}
7694
await awaitsFor(()=>{
7795
return $("#problems-panel").is(":visible");
7896
}, "Problems panel to be visible");
@@ -115,6 +133,12 @@ define(function (require, exports, module) {
115133
it("should show errors if invalid .jshintrc extend file detected", async function () {
116134
await SpecRunnerUtils.loadProjectInTestWindow(testProjectsFolder + "invalid-config-extend");
117135
await awaitsForDone(SpecRunnerUtils.openProjectFiles(["no-errors.js"]), "open test file");
136+
await awaitsFor(()=>{
137+
return $("#status-inspection").hasClass("inspection-errors");
138+
}, "Lint errors to be detected");
139+
if (!$("#problems-panel").is(":visible")) {
140+
CommandManager.execute(Commands.VIEW_TOGGLE_PROBLEMS);
141+
}
118142
await awaitsFor(()=>{
119143
return $("#problems-panel").is(":visible");
120144
}, "Problems panel to be visible");

0 commit comments

Comments
 (0)