Skip to content

Commit 0981580

Browse files
committed
pdev:set
1 parent c68bbc5 commit 0981580

File tree

3 files changed

+40
-50
lines changed

3 files changed

+40
-50
lines changed

@push.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

index.ts

Lines changed: 40 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const sumanTestRegex = /'<suman-test>'/;
4949
*/
5050

5151
const getTopHtml = function () {
52-
52+
5353
return [
5454
'<!DOCTYPE html>',
5555
'<html lang="en">',
@@ -70,9 +70,9 @@ const getBottomHtml = function () {
7070
};
7171

7272
const getEmbeddedScript = function (port: number, id: number, sumanConfigStr: string, sumanOptsStr: string) {
73-
73+
7474
const timestamp = Date.now();
75-
75+
7676
return [
7777
'<script>',
7878
`window.__suman = window.__suman || {};\n`,
@@ -85,7 +85,7 @@ const getEmbeddedScript = function (port: number, id: number, sumanConfigStr: st
8585
`window.__suman.sumanOpts=${sumanOptsStr};\n`,
8686
'</script>'
8787
];
88-
88+
8989
};
9090

9191
const getSumanLibScript = function (cb: Function) {
@@ -96,68 +96,70 @@ const getSumanLibScript = function (cb: Function) {
9696
if (err) {
9797
return cb(err);
9898
}
99-
99+
100100
cb(null, [
101101
'<script>',
102102
String(data),
103103
'</script>'
104104
]);
105-
105+
106106
});
107107
};
108108

109109
const getWebpackBuild = function (sumanHelperDir: string) {
110-
110+
111111
return function (cb: Function) {
112-
112+
113113
let p = path.resolve(sumanHelperDir + '/browser/builds/browser-tests.js');
114-
114+
115115
fs.readFile(p, 'utf8', function (err: Error, data: string) {
116116
if (err) {
117117
return cb(err);
118118
}
119-
119+
120120
cb(null, [
121121
'<script>',
122122
String(data),
123123
'</script>'
124124
]);
125-
125+
126126
});
127127
}
128128
};
129129

130130
export const makeGetBrowserStream = function (sumanHelperDir: string, sumanConf: ISumanConfig, sumanOpts: ISumanOpts) {
131-
131+
132132
const sumanOptsStr = su.customStringify(sumanOpts);
133133
const sumanConfigStr = su.customStringify(sumanConf);
134-
134+
135135
return function getBrowserStream(port: number, id: number, cb: Function) {
136-
136+
137137
async.parallel([
138-
139-
getSumanLibScript,
140-
getWebpackBuild(sumanHelperDir)
141-
142-
], function (err: Error, results: any) {
143-
144-
if (err) {
145-
return cb(err);
146-
}
147-
148-
// join all results together
149-
const all = <Array<Array<string>>> [
150-
getTopHtml(),
151-
getEmbeddedScript(port, id, sumanConfigStr, sumanOptsStr),
152-
results,
153-
getBottomHtml()
154-
];
155-
156-
const allStr = _.flattenDeep(all.reduce((a, b) => a.concat(b), []));
157-
cb(null, allStr);
158-
159-
})
160-
138+
139+
getSumanLibScript,
140+
getWebpackBuild(sumanHelperDir)
141+
142+
],
143+
144+
function (err: Error, results: any) {
145+
146+
if (err) {
147+
return cb(err);
148+
}
149+
150+
// join all results together
151+
const all = <Array<Array<string>>> [
152+
getTopHtml(),
153+
getEmbeddedScript(port, id, sumanConfigStr, sumanOptsStr),
154+
results,
155+
getBottomHtml()
156+
];
157+
158+
const allStr = _.flattenDeep(all.reduce((a, b) => a.concat(b), []));
159+
cb(null, allStr);
160+
161+
})
162+
161163
}
162-
164+
163165
};
File renamed without changes.

0 commit comments

Comments
 (0)