Skip to content

Commit 330ee30

Browse files
committed
Test relative paths
1 parent 033f45f commit 330ee30

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

build/build_test.js

Lines changed: 20 additions & 1 deletion
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 files to static dist", function(){
125+
it("copy staticDist folders to static dist", function(){
126126
this.timeout(120000);
127127
return build.staticDist({
128128
forceBuild: true,
@@ -141,6 +141,25 @@ describe("documentjs/lib/generators/html/build",function(){
141141
});
142142
});
143143

144+
it.only("copy staticDist files to static dist", function(){
145+
this.timeout(120000);
146+
return build.staticDist({
147+
forceBuild: true,
148+
html: {
149+
dependencies: {
150+
"can-component": "3.0.0-pre.9"
151+
},
152+
staticDist: [
153+
'./test-static-dist.html'
154+
]
155+
},
156+
}).then(function(result){
157+
return read(path.join(__dirname, "..", result.distFolder, "test-static-dist.html"));
158+
}).then(function(res){
159+
assert.ok(/hello world/.test(res), "got static.js with component");
160+
});
161+
});
162+
144163
it("makes linked content",function(done){
145164
var options = {
146165
html: { templates: path.join(__dirname,"test","escaped") },

site/default/static/build.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ module.exports = function(options, folders){
2323
if(!path.isAbsolute(dist)){
2424
dist = path.join(process.cwd(), dist);
2525
}
26-
staticDistPromises.push(copy(dist, out));
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));
2733
});
2834
}
2935

test-static-dist.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hello world

0 commit comments

Comments
 (0)