Skip to content

Commit 0273a01

Browse files
Chasen Le Harachasenlehara
authored andcommitted
Upgrade to StealJS 2 & QUnit 2
This should fix some stability issues with the tests.
1 parent ef77f86 commit 0273a01

File tree

2 files changed

+32
-25
lines changed

2 files changed

+32
-25
lines changed

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,18 @@
5656
"unescape-html": "^1.0.0"
5757
},
5858
"devDependencies": {
59-
"bit-docs-generate-html": "^0.8.0",
59+
"bit-docs-generate-html": "^0.11.0",
6060
"bit-docs-generate-searchmap": "^0.2.0",
61-
"bit-docs-html-toc": "^0.6.0",
61+
"bit-docs-html-toc": "^1.1.1",
6262
"connect": "^3.5.0",
6363
"funcunit": "^3.4.3",
6464
"http-server": "^0.11.0",
6565
"normalize.css": "^5.0.0",
6666
"q": "^1.4.1",
67-
"steal": "^1.5.9",
67+
"steal": "^2.0.0",
6868
"steal-conditional": "^1.0.0",
69-
"steal-qunit": "^1.0.1",
70-
"steal-tools": "^1.8.2",
69+
"steal-qunit": "^2.0.0",
70+
"steal-tools": "^2.0.0",
7171
"test-saucelabs": "^0.0.6",
7272
"testee": "^0.9.0",
7373
"zombie": "^6.0.0"

test/search.js

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,36 @@ var indexOfPageInResults = function(pageName, results) {
1313
}
1414
};
1515

16-
/* Clear local storage */
17-
window.localStorage.clear();
18-
19-
/* Render the search templates into the page */
20-
var qunitFixture = document.getElementById('qunit-fixture');
21-
qunitFixture.appendChild(searchBarTemplate());
22-
qunitFixture.appendChild(searchResultsTemplate());
23-
24-
/* Create a new instance of the search control */
25-
var search = new SearchControl('.search-bar', {
26-
pathPrefix: '../doc'
27-
});
16+
var search;
17+
var setUpSearchControl;
2818

2919
/* Tests */
30-
QUnit.module('search control');
20+
QUnit.module('search control', {
21+
before: function() {
22+
23+
/* Clear local storage */
24+
window.localStorage.clear();
25+
26+
/* Render the search templates into the page */
27+
var qunitFixture = document.getElementById('qunit-fixture');
28+
qunitFixture.appendChild(searchBarTemplate());
29+
qunitFixture.appendChild(searchResultsTemplate());
30+
31+
/* Create a new instance of the search control */
32+
search = new SearchControl('.search-bar', {
33+
pathPrefix: '../doc'
34+
});
35+
36+
setUpSearchControl = search.searchEnginePromise.then(function(searchMap) {
37+
return new Promise(function(resolve) {
38+
// Wait for the search worker to be set up
39+
setTimeout(function() {
40+
resolve(searchLogic.indexData(search.convertSearchMapToIndexableItems(searchMap)));
41+
}, 2000);
42+
});
43+
});
3144

32-
var setUpSearchControl = search.searchEnginePromise.then(function(searchMap) {
33-
return new Promise(function(resolve) {
34-
// Wait for the search worker to be set up
35-
setTimeout(function() {
36-
resolve(searchLogic.indexData(search.convertSearchMapToIndexableItems(searchMap)));
37-
}, 2000);
38-
});
45+
}
3946
});
4047

4148
QUnit.test('Search results render', function(assert) {

0 commit comments

Comments
 (0)