Skip to content

Commit 02bbb48

Browse files
committed
Fix test for relative paths
1 parent 330ee30 commit 02bbb48

File tree

3 files changed

+6
-13
lines changed

3 files changed

+6
-13
lines changed

build/build_test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ describe("documentjs/lib/generators/html/build",function(){
122122
});
123123
});
124124

125-
it("copy staticDist folders to static dist", function(){
125+
it("copy absolute staticDist folders to static dist", function(){
126126
this.timeout(120000);
127127
return build.staticDist({
128128
forceBuild: true,
@@ -141,7 +141,7 @@ describe("documentjs/lib/generators/html/build",function(){
141141
});
142142
});
143143

144-
it.only("copy staticDist files to static dist", function(){
144+
it("copy relative staticDist folders to static dist", function(){
145145
this.timeout(120000);
146146
return build.staticDist({
147147
forceBuild: true,
@@ -150,13 +150,13 @@ describe("documentjs/lib/generators/html/build",function(){
150150
"can-component": "3.0.0-pre.9"
151151
},
152152
staticDist: [
153-
'./test-static-dist.html'
153+
'./test-static-dist'
154154
]
155155
},
156156
}).then(function(result){
157-
return read(path.join(__dirname, "..", result.distFolder, "test-static-dist.html"));
157+
return read(path.join(__dirname, "..", result.distFolder, "test.css"));
158158
}).then(function(res){
159-
assert.ok(/hello world/.test(res), "got static.js with component");
159+
assert.ok(/#TestID/.test(res), "got static.js with component");
160160
});
161161
});
162162

site/default/static/build.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,7 @@ module.exports = function(options, folders){
2323
if(!path.isAbsolute(dist)){
2424
dist = path.join(process.cwd(), dist);
2525
}
26-
staticDistPromises.push(new Promise(function(resolve, reject){
27-
fsExtra.copy(function(err, res){
28-
if(err) return reject(err);
29-
resolve(res);
30-
});
31-
}));
32-
//staticDistPromises.push(copy(dist, out));
26+
staticDistPromises.push(copy(dist, out));
3327
});
3428
}
3529

test-static-dist.html

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)