Skip to content

Commit

Permalink
fix path issues with tests
Browse files Browse the repository at this point in the history
  • Loading branch information
techjacker committed Nov 7, 2015
1 parent fad43c7 commit 5818b9d
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 28 deletions.
18 changes: 9 additions & 9 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "node-version-assets",
"version": "0.2.0",
"version": "1.0.0",
"description": "version your static assets",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -48,14 +48,14 @@
"version",
"versioning"
],
"devDependencies": {
"tap": "https://github.com/isaacs/node-tap/archive/master.tar.gz",
"curry": "0.0.4",
"async": "~0.2.5"
},
"dependencies": {
"underscore": "~1.4.4",
"async": "~0.2.1",
"crypto": "0.0.3"
"async": "^1.5.0",
"crypto": "0.0.3",
"underscore": "^1.8.3"
},
"devDependencies": {
"async": "^1.5.0",
"curry": "^1.2.0",
"tap": "^2.2.0"
}
}
8 changes: 5 additions & 3 deletions test/create.test.js
@@ -1,15 +1,17 @@
var test = require('tap').test,
async = require('async'),
fs = require('fs'),
path = require('path'),
_ = require('underscore'),
Stream = require('stream'),
// my libs

// internal modules
Replacer = require('../lib/replace-text'),
Creator = require('../lib/create');


// common test class vars
var fixturesDir = '../test-utils/fixtures/',
var fixturesDir = path.join(process.cwd(), '/test-utils/fixtures/'),
// var fixturesDir = 'test-utils/fixtures/',
cssDir = fixturesDir + 'css/',
cssFile = "all-min.css",
Expand Down Expand Up @@ -72,4 +74,4 @@ test('Creator.run(): shd write file', function(t) {
t.end();
});
});
});
});
20 changes: 11 additions & 9 deletions test/grep.test.js
@@ -1,17 +1,19 @@
var test = require('tap').test,
fs = require('fs'),
_ = require('underscore'),
Stream = require('stream'),
// my libs
Replacer = require('../lib/replace-text'),
Grepper = require('../lib/grep');
var test = require('tap').test,
fs = require('fs'),
path = require('path'),
_ = require('underscore'),
Stream = require('stream'),

// internal modules
Replacer = require('../lib/replace-text'),
Grepper = require('../lib/grep');

var opts = {
// newVersion: 123456,
newVersion: (new Date()).getTime(),
requireJs: true,
cb: function (err, results) {},
filePath: "../test-utils/fixtures/index.html",
filePath: path.join(process.cwd(), "test-utils/fixtures/index.html"),
assets: ["css/all-min.css", "js/app.newie.js", "js/app.oldie.js"]
};

Expand Down Expand Up @@ -54,4 +56,4 @@ test('Grep.run(): pipes streams', function(t) {

// fire away!
grep.run();
});
});
5 changes: 3 additions & 2 deletions test/hash.test.js
@@ -1,5 +1,6 @@
var test = require('tap').test,
async = require('async'),
path = require('path'),
fs = require('fs'),
_ = require('underscore'),
Stream = require('stream'),
Expand All @@ -9,7 +10,7 @@ var test = require('tap').test,


// common test class vars
var fixturesDir = '../test-utils/fixtures/',
var fixturesDir = path.join(process.cwd(), 'test-utils/fixtures/'),
cssDir = fixturesDir + 'css/',
cssFile = "all-min.css",
opts = {
Expand Down Expand Up @@ -50,4 +51,4 @@ test('Hash.run(): shd create md5 hash', function(t) {
// t.equal(JSON.stringify(results), ["newHash"], "hashes are different after appending content");
// t.equal(JSON.stringify(originalHash), ["newHash"], "hashes are different after appending content");
})
});
});
11 changes: 6 additions & 5 deletions test/main.test.js
@@ -1,17 +1,18 @@
var test = require('tap').test,
_ = require('underscore'),
async = require('async'),
path = require('path'),
fs = require('fs'),
// my libs
Main = require('../lib/main');

// my test vars
var cssFile = "all-min.css",
var cssFile = "all-min.css",
jsNewie = "app.newie.js",
jsOldie = "app.oldie.js",
fixturesDir = './../test-utils/fixtures/',
cssDir = fixturesDir + 'css/',
jsDir = fixturesDir + 'js/',
fixturesDir = path.join(process.cwd(), 'test-utils/fixtures/'),
cssDir = fixturesDir + 'css/',
jsDir = fixturesDir + 'js/',
opts = {
cb: function (err, results) {},
assets: [cssDir + cssFile, jsDir + jsNewie, jsDir + jsOldie],
Expand Down Expand Up @@ -165,4 +166,4 @@ test('Main.run(): md5 versioning', function(t) {
mainMd5.run(callMe);
// fixtures dir = dif when run from this script (rather than npm run-script pretest)
}, fixturesDir);
});
});

0 comments on commit 5818b9d

Please sign in to comment.