Skip to content

Commit

Permalink
changed name to postbuild
Browse files Browse the repository at this point in the history
  • Loading branch information
Danny Moerkerke committed Mar 30, 2016
1 parent 369a323 commit d4e73b2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "replacer",
"version": "1.0.0",
"description": "A command line utility to inject css and js files into an html file or to remove code based on conditions.",
"bin": "./replacer",
"bin": "./postbuild",
"scripts": {
"test": "tape tests/*.js | faucet"
},
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions tests/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ before('test setup', (t) => {
});

test('test injection of all stylesheets in directory', (t) => {
exec(`./replacer -i ${inputFile} -o ${outputFile} -c ${tmpDir}`, (err) => {
exec(`./postbuild -i ${inputFile} -o ${outputFile} -c ${tmpDir}`, (err) => {

fs.readFile(`${outputFile}`, (err, data) => {
cssFiles.forEach((file) => {
Expand All @@ -93,7 +93,7 @@ test('test injection of all stylesheets in directory', (t) => {
});

test('test injection of all javascripts in directory', (t) => {
exec(`./replacer -i ${inputFile} -o ${outputFile} -j ${tmpDir}`, (err) => {
exec(`./postbuild -i ${inputFile} -o ${outputFile} -j ${tmpDir}`, (err) => {

fs.readFile(`${outputFile}`, (err, data) => {
jsFiles.forEach((file) => {
Expand All @@ -106,7 +106,7 @@ test('test injection of all javascripts in directory', (t) => {
});

test('test injection of single stylesheet', (t) => {
exec(`./replacer -i ${inputFile} -o ${outputFile} -c ${tmpDir}/${cssFiles[0]}`, (err) => {
exec(`./postbuild -i ${inputFile} -o ${outputFile} -c ${tmpDir}/${cssFiles[0]}`, (err) => {

fs.readFile(`${outputFile}`, (err, data) => {
t.equal(true, data.indexOf(`${tmpDir}/${cssFiles[0]}`) !== -1, `expect ${cssFiles[0]} to be injected`);
Expand All @@ -117,7 +117,7 @@ test('test injection of single stylesheet', (t) => {
});

test('test injection of single javascript', (t) => {
exec(`./replacer -i ${inputFile} -o ${outputFile} -j ${tmpDir}/${jsFiles[0]}`, (err) => {
exec(`./postbuild -i ${inputFile} -o ${outputFile} -j ${tmpDir}/${jsFiles[0]}`, (err) => {

fs.readFile(`${outputFile}`, (err, data) => {
t.equal(true, data.indexOf(`${tmpDir}/${jsFiles[0]}`) !== -1, `expect ${jsFiles[0]} to be injected`);
Expand All @@ -128,7 +128,7 @@ test('test injection of single javascript', (t) => {
});

test('test removal of development code', (t) => {
exec(`./replacer -i ${inputFile} -o ${outputFile} -r development`, (err) => {
exec(`./postbuild -i ${inputFile} -o ${outputFile} -r development`, (err) => {
const devRegex = new RegExp('(<!\\-\\- remove:development \\-\\->)([\\s\\S]*?)(<!\\-\\- endremove \\-\\->)');
const prodRegex = new RegExp('(<!\\-\\- remove:production \\-\\->)([\\s\\S]*?)(<!\\-\\- endremove \\-\\->)');

Expand All @@ -142,7 +142,7 @@ test('test removal of development code', (t) => {
});

test('test removal of production code', (t) => {
exec(`./replacer -i ${inputFile} -o ${outputFile} -r production`, (err) => {
exec(`./postbuild -i ${inputFile} -o ${outputFile} -r production`, (err) => {
const prodRegex = new RegExp('(<!\\-\\- remove:production \\-\\->)([\\s\\S]*?)(<!\\-\\- endremove \\-\\->)');
const devRegex = new RegExp('(<!\\-\\- remove:development \\-\\->)([\\s\\S]*?)(<!\\-\\- endremove \\-\\->)');

Expand Down

0 comments on commit d4e73b2

Please sign in to comment.