Skip to content

Commit

Permalink
Add failing test for skipping .git dir in root style apps
Browse files Browse the repository at this point in the history
  • Loading branch information
edrex committed Mar 17, 2015
1 parent 689be04 commit 948cab0
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
1 change: 1 addition & 0 deletions test/apps/compile/root/_harp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
39 changes: 38 additions & 1 deletion test/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,47 @@ describe("compile", function(){

})

describe("root app", function(){
var projectPath = path.join(__dirname, "apps/compile/root")
var outputPath = path.join(__dirname, "out/compile-root")

// Making this at runtime since git refuses to store .git dirs
fs.mkdirSync(path.join(projectPath, ".git"));
fs.openSync(path.join(projectPath, "/.git/foo"), 'a')

it("should compile", function(done){
harp.compile(projectPath, outputPath, function(error){
should.not.exist(error)
done()
})
})

it("should not include .git", function(done) {
var rsp = fs.existsSync(path.join(projectPath, ".git/foo"))
rsp.should.be.true

var rsp = fs.existsSync(path.join(outputPath, ".git/foo"))
rsp.should.be.false

var rsp = fs.existsSync(path.join(outputPath, "git"))
rsp.should.be.false

done()
})

after(function(done){
exec("rm -rf " + path.join(projectPath, ".git"), function(){
done()
})
})

})


after(function(done){
exec("rm -rf " + path.join(__dirname, "out"), function(){
done()
})
})

})
})

0 comments on commit 948cab0

Please sign in to comment.