Add test for file expand behavior
This commit is contained in:
parent
86aaa6d453
commit
dc793d4843
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,4 +5,3 @@ tmp
|
|||||||
tmp
|
tmp
|
||||||
junit
|
junit
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.grunt
|
|
||||||
|
@ -88,12 +88,6 @@ module.exports = function(grunt) {
|
|||||||
// specs: 'test/fixtures/syntaxError/spec/**/*.js'
|
// specs: 'test/fixtures/syntaxError/spec/**/*.js'
|
||||||
// }
|
// }
|
||||||
// },
|
// },
|
||||||
fileExpand: {
|
|
||||||
src: ['test/fixtures/fileExpand/src/**/*.js', '!test/fixtures/fileExpand/src/exclude.js'],
|
|
||||||
options: {
|
|
||||||
specs: ['test/fixtures/fileExpand/spec/**/*.js', '!test/fixtures/fileExpand/spec/exclude.js']
|
|
||||||
}
|
|
||||||
},
|
|
||||||
customTemplate: {
|
customTemplate: {
|
||||||
src: 'test/fixtures/pivotal/src/**/*.js',
|
src: 'test/fixtures/pivotal/src/**/*.js',
|
||||||
options: {
|
options: {
|
||||||
|
7
test/fixtures/fileExpand/spec/exclude.js
vendored
7
test/fixtures/fileExpand/spec/exclude.js
vendored
@ -1,7 +0,0 @@
|
|||||||
describe('fileExpand (excluded spec)', function() {
|
|
||||||
|
|
||||||
it('should exclude spec files', function() {
|
|
||||||
expect(true).not.toBeTruthy();
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
8
test/fixtures/fileExpand/spec/include.js
vendored
8
test/fixtures/fileExpand/spec/include.js
vendored
@ -1,8 +0,0 @@
|
|||||||
describe('fileExpand', function() {
|
|
||||||
|
|
||||||
it('should exclude src files', function() {
|
|
||||||
expect(include).toEqual(true);
|
|
||||||
expect(typeof exclude).toEqual('undefined');
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
@ -1,6 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var grunt = require('grunt');
|
var grunt = require('grunt'),
|
||||||
|
phantomjs = require('grunt-lib-phantomjs').init(grunt),
|
||||||
|
jasmine = require('../tasks/lib/jasmine.js').init(grunt, phantomjs);
|
||||||
|
|
||||||
// Majority of test benefit comes from running the task itself.
|
// Majority of test benefit comes from running the task itself.
|
||||||
|
|
||||||
@ -39,6 +41,13 @@ exports.jasmine = {
|
|||||||
|
|
||||||
test.equal(normalize(actual),normalize(expected), 'default test runner template');
|
test.equal(normalize(actual),normalize(expected), 'default test runner template');
|
||||||
|
|
||||||
|
test.done();
|
||||||
|
},
|
||||||
|
|
||||||
|
fileExpand: function(test) {
|
||||||
|
var patterns = ['test/fixtures/fileExpand/src/*.js', '!test/fixtures/fileExpand/src/exclude.js']
|
||||||
|
var expected = ['test/fixtures/fileExpand/src/include.js'];
|
||||||
|
test.deepEqual(jasmine.getRelativeFileList('', patterns, {}), expected, 'should properly expand file list')
|
||||||
test.done();
|
test.done();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user