Review fixes

This commit is contained in:
Kieran Sedgwick 2014-05-26 16:57:08 -04:00
parent a4c0874668
commit 823232fc67
5 changed files with 13 additions and 7954 deletions

7920
dist/filer_node.js vendored

File diff suppressed because it is too large Load Diff

View File

@ -52,7 +52,7 @@ module.exports = function(grunt) {
},
browserify: {
standalone: {
filerDist: {
src: "./src/index.js",
dest: "./dist/filer.js",
options: {
@ -63,29 +63,18 @@ module.exports = function(grunt) {
}
}
},
testVersion: {
src: "./src/index.js",
filerTest: {
src: "./tests/index.js",
dest: "./dist/filer-test.js",
options: {
standalone: 'Filer',
browserifyOptions: {
builtins: false,
commondir: false
}
}
},
testApp: {
src: "./tests/index.js",
dest: "./tests/test-bundle.js",
options: {
standalone: 'Filer test suite'
standalone: 'FilerTest'
}
}
},
shell: {
mocha: {
command: './node_modules/.bin/mocha --reporter list --no-exit tests/index.js'
command: './node_modules/.bin/mocha --reporter list tests/index.js'
}
},
@ -160,13 +149,13 @@ module.exports = function(grunt) {
}
},
connect: {
server_for_node: {
serverForNode: {
options: {
port: 1234,
base: '.'
}
},
server_for_browser: {
serverForBrowser: {
options: {
port: 1234,
base: '.',
@ -189,10 +178,9 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-browserify');
grunt.registerTask('develop', ['clean', 'browserify:standalone']);
grunt.registerTask('filer-test', ['clean', 'browserify:testVersion', 'browserify:testApp']);
grunt.registerTask('develop', ['clean', 'browserify:filerDist']);
grunt.registerTask('build-tests', ['clean', 'browserify:filerTest']);
grunt.registerTask('release', ['develop', 'uglify']);
grunt.registerTask('check', ['jshint']);
grunt.registerTask('publish', 'Publish filer as a new version to NPM, bower and github.', function(patchLevel) {
var allLevels = ['patch', 'minor', 'major'];
@ -223,8 +211,8 @@ module.exports = function(grunt) {
'npm-publish'
]);
});
grunt.registerTask('test-node', ['check', 'clean', 'connect:server_for_node', 'shell:mocha']);
grunt.registerTask('test-browser', ['check', 'filer-test', 'connect:server_for_browser']);
grunt.registerTask('test-node', ['jshint', 'clean', 'connect:serverForNode', 'shell:mocha']);
grunt.registerTask('test-browser', ['jshint', 'build-tests', 'connect:serverForBrowser']);
grunt.registerTask('test', ['test-node']);
grunt.registerTask('default', ['test']);

View File

@ -8,16 +8,12 @@
<script>
mocha.setup('bdd').timeout(5000).slow(250);;
// Intentional globals
expect = chai.expect;
assert = chai.assert;
window.onload = function() {
mocha.checkLeaks();
mocha.run();
};
</script>
<script src="test-bundle.js"></script>
<script src="../dist/filer-test.js"></script>
</head>
<body>
<div id="mocha"></div>

View File

@ -1,8 +1,2 @@
// Tests to be run are defined in test-manifest.js
// For Nodejs context, expose chai's expect method
if (typeof GLOBAL !== "undefined") {
GLOBAL.expect = require('chai').expect;
}
require('./test-manifest.js');

View File

@ -1,5 +1,6 @@
var Filer = require('../../..');
var util = require('../../lib/test-utils.js');
var expect = require('chai').expect;
describe('FileSystemShell.cd', function() {
beforeEach(util.setup);