Skip to content

Commit

Permalink
references #378, build tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dbashford committed Feb 9, 2015
1 parent a5f3ac9 commit cc7269a
Show file tree
Hide file tree
Showing 10 changed files with 129 additions and 22 deletions.
1 change: 1 addition & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ As updates to external modules are listed here, know that you can use them right
* [mimosa-live-reload #7](https://github.com/dbashford/mimosa-live-reload/issues/7). Readdressed the hack for getting Chrome to repaint CSS updates whether or not it has focus.
* [mimosa-live-reload](https://github.com/dbashford/mimosa-live-reload). Updated to latest and updated socket.io.
* [mimosa-copy #1](https://github.com/dbashford/mimosa-copy/issues/1). Added `.swf` to default copy extensions.
* [mimosa-copy #3](https://github.com/dbashford/mimosa-copy/pull/3) added `woff2` to default copy extensions.
* [mimosa-csslint #4](https://github.com/dbashford/mimosa-csslint/issues/4). Now properly recognizes vendor files on startup.
* [mimosa-csslint](https://github.com/dbashford/mimosa-csslint/). Updated to latest csslint.
* [mimosa-jshint](https://github.com/dbashford/mimosa-jshint/). Updated to latest jshint.
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@
"lodash": "2.4.1",
"logmimosa": "1.0.3",
"mimosa-bower": "1.8.1",
"mimosa-coffeescript": "^1.3.2",
"mimosa-copy": "1.3.1",
"mimosa-copy": "1.3.2",
"mimosa-csslint": "2.0.1",
"mimosa-jshint": "2.0.0",
"mimosa-live-reload": "1.3.0",
Expand Down
3 changes: 3 additions & 0 deletions test/harness/configs/watcher/build-delay.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
exports.config = {
modules: ['copy'],
watch: {
delay:100
},
logger: {
growl: {
enabled: false
Expand Down
11 changes: 11 additions & 0 deletions test/harness/configs/watcher/build-exclude-both.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
exports.config = {
modules: ['copy'],
watch: {
exclude: [/main.js$/, "javascripts/vendor/requirejs/require.js"]
},
logger: {
growl: {
enabled: false
}
}
};
3 changes: 3 additions & 0 deletions test/harness/configs/watcher/build-exclude-regex.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
exports.config = {
modules: ['copy'],
watch: {
exclude: [/main.js$/, /require.js$/]
},
logger: {
growl: {
enabled: false
Expand Down
3 changes: 3 additions & 0 deletions test/harness/configs/watcher/build-exclude-string.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
exports.config = {
modules: ['copy'],
watch: {
exclude: ["javascripts/main.js", "javascripts/vendor/requirejs/require.js"]
},
logger: {
growl: {
enabled: false
Expand Down
6 changes: 5 additions & 1 deletion test/harness/configs/watcher/build-interval.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
exports.config = {
modules: ['copy'],
watch: {
interval:300
},
logger: {
growl: {
enabled: false
}
}
};
};

14 changes: 14 additions & 0 deletions test/harness/configs/watcher/build-polling.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
exports.config = {
modules: ['copy'],
watch: {
usePolling: false
},
logger: {
growl: {
enabled: false
}
}
};



3 changes: 3 additions & 0 deletions test/harness/configs/watcher/build-throttle.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
exports.config = {
modules: ['copy'],
watch: {
throttle:1
},
logger: {
growl: {
enabled: false
Expand Down
104 changes: 85 additions & 19 deletions test/integrations/util/watcher-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,13 @@ var runTest = function(testSpec, project, codebase, cmd, test) {
};

var filesDirectoriesInFolder = function(dir){
console.log(wrench.readdirSyncRecursive(dir))
return wrench.readdirSyncRecursive(dir).length;
}

var basicRun = function(finishedLoc, filesOut) {
var basicBuild = function(finishedLoc, filesOut) {
return function(sout, projectData, done) {
var assetCount = filesDirectoriesInFolder(projectData.publicDir);
expect(sout.indexOf("Finished build")).to.above(finishedLoc);
expect(sout.indexOf("Finished build")).to.be.above(finishedLoc);
expect(assetCount).to.eql(filesOut);
done();
};
Expand All @@ -53,45 +52,112 @@ describe("Mimosa's watcher", function() {
"watcher/build-empty",
"empty",
"build",
basicRun(100, 0)
basicBuild(100, 0)
);

describe("will process all of a projects files into the public directory", function() {

var basicTest = basicBuild(500, 11);

runTest(
"with the default config",
"watcher/build",
"basic",
"build",
basicRun(500, 11)
);
basicTest
);

it("when throttle is set", function(){});
it("when delay is set", function(){});
it("when interval is set", function(){});
it("when polling is set to false", function(){});
runTest(
"when throttle is set",
"watcher/build-throttle",
"basic",
"build",
basicTest
);

runTest(
"when delay is set",
"watcher/build-delay",
"basic",
"build",
basicTest
);

runTest(
"when interval is set",
"watcher/build-interval",
"basic",
"build",
basicTest
);

runTest(
"when polling is set to false",
"watcher/build-polling",
"basic",
"build",
basicTest
);
});

describe("will exclude files from being processed into the public directory", function() {
it("via string match", function(){});
it("via regex match", function(){});
});
runTest(
"via string match",
"watcher/build-exclude-string",
"basic",
"build",
basicBuild(400, 8);
);

runTest(
"via regex match",
"watcher/build-exclude-regex",
"basic",
"build",
basicBuild(400, 8);
);

runTest(
"via both string and regex match",
"watcher/build-exclude-both",
"basic",
"build",
basicBuild(400, 8);
);
});
});

describe("on mimosa watch", function() {

it("will stop watching and exit when STOPMIMOSA is sent", function(){})
it("will stop watching and exit when STOPMIMOSA is sent");

describe("will exclude files from being added into the public directory", function() {
it("via string exclude");
it("via regex exclude");
it("via string and regex exclude");
});

describe("after the initial build", function(){
it("will keep watching", function(){});
it("will process file adds", function(){})
it("will process file deletes", function(){});
it("will process file updates", function(){});
it("will process file moves (add and delete at same time)", function(){});
it("will keep watching");
it("will process file adds");
it("will process file deletes");
it("will process file updates");
it("will process file moves (add and delete at same time)");

describe("with throttle engaged", function() {
it("will process file adds");
it("will process file moves (add and delete at same time)");
});

describe("with delay engaged", function() {
it("will process file adds")
it("will process file updates");
it("will process file moves (add and delete at same time)");
});
});

it("can handle adding file to empty project")

});

});

0 comments on commit cc7269a

Please sign in to comment.