Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change test extension to .lint-test.js #48

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function JSHinter (inputNode, options) {
}

JSHinter.prototype.extensions = ['js'];
JSHinter.prototype.targetExtension = 'lint.js';
JSHinter.prototype.targetExtension = 'lint-test.js';

JSHinter.prototype.baseDir = function() {
return __dirname;
Expand Down
12 changes: 6 additions & 6 deletions tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ describe('broccoli-jshint', function(){
builder = new broccoli.Builder(node);
return builder.build().then(function() {
var expected = [
'\n' + chalk.red('core.js: line 1, col 20, Missing semicolon.\n\n1 error') + '\n\n' + chalk.red('main.js: line 1, col 1, Missing semicolon.\n\n1 error') + '\n',
'\n' + chalk.red('core.js: line 1, col 20, Missing semicolon.\n\n1 error') + '\n\n' + chalk.red('main.js: line 1, col 10, Missing semicolon.\n\n1 error') + '\n',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why this error message changed, but I figure it must be a bug fix in jshint. The new error message (col 10) is better than the old error message (col 1).

chalk.yellow('===== 2 JSHint Errors\n')
]
expect(consoleLogOutput).to.eql(expected);
Expand Down Expand Up @@ -193,9 +193,9 @@ describe('broccoli-jshint', function(){
return builder.build().then(function(results) {
var dir = results.directory;

expect(readFile(dir + '/core.lint.js')).to.match(/Missing semicolon./)
expect(readFile(dir + '/core.lint-test.js')).to.match(/Missing semicolon./)

expect(readFile(dir + '/look-no-errors.lint.js')).to.match(/ok\(true, 'look-no-errors.js should pass jshint.'\);/)
expect(readFile(dir + '/look-no-errors.lint-test.js')).to.match(/ok\(true, 'look-no-errors.js should pass jshint.'\);/)
});
});

Expand All @@ -218,7 +218,7 @@ describe('broccoli-jshint', function(){
var dir = results.directory;

expect(escapeErrorStringCalled).to.be.ok;
expect(readFile(dir + '/core.lint.js')).to.match(/blazhorz/)
expect(readFile(dir + '/core.lint-test.js')).to.match(/blazhorz/)
});
});

Expand All @@ -234,9 +234,9 @@ describe('broccoli-jshint', function(){
return builder.build().then(function(results) {
var dir = results.directory;

expect(readFile(dir + '/core.lint.js')).to.not.match(/Missing semicolon./)
expect(readFile(dir + '/core.lint-test.js')).to.not.match(/Missing semicolon./)

expect(readFile(dir + '/look-no-errors.lint.js')).to.not.match(/ok\(true, 'look-no-errors.js should pass jshint.'\);/)
expect(readFile(dir + '/look-no-errors.lint-test.js')).to.not.match(/ok\(true, 'look-no-errors.js should pass jshint.'\);/)
});
});
});
Expand Down