1 | /**
|
2 | * TODO: refactor out into a "jenkins-testutil" npm module? UIThemes has a "helper" module that could go there too.
|
3 | */
|
4 |
|
5 | var jsdom = require("jsdom");
|
6 |
|
7 | exports.onJenkinsPage = function(testFunc, content) {
|
8 | if (!content) {
|
9 | content = '<html><head data-rooturl="/jenkins" data-adjuncturl="/jenkins/adjuncts/xxx" data-resurl="/jenkins/static/xxx"></head><body><div></div></body></html>';
|
10 | }
|
11 | jsdom.env(content, [],
|
12 | function (errors, window) {
|
13 | require("window-handle").setWindow(window);
|
14 | require("../js/internal").clearJenkinsGlobal();
|
15 | testFunc();
|
16 | }
|
17 | );
|
18 | } |
\ | No newline at end of file |