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

View File

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

View File

@ -1,8 +1,2 @@
// Tests to be run are defined in test-manifest.js // 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'); require('./test-manifest.js');

View File

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