Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

Commit

Permalink
Add test for exlusion of foreign jshintrc from search
Browse files Browse the repository at this point in the history
  • Loading branch information
ro0gr committed Sep 18, 2016
1 parent cba9ad9 commit 341f4ec
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions node-tests/blueprints/ember-cli-eslint-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

var blueprintHelpers = require('ember-cli-blueprint-test-helpers/helpers');
var setupTestHooks = blueprintHelpers.setupTestHooks;
var fs = require('fs-extra');
var path = require('path');
var emberNew = blueprintHelpers.emberNew;
var emberGenerate = blueprintHelpers.emberGenerate;

Expand Down Expand Up @@ -69,6 +71,33 @@ describe('Acceptance: install ember-cli-eslint', function() {
});
});

it('Does not touch foreign .jshintrc files', function() {
var args = ['ember-cli-eslint', 'foo'];
var foreignJshintrcPaths = [
path.join('.', 'bower_components', 'foreign-package', '.jshintrc'),
path.join('.', 'tmp', '.jshintrc'),
path.join('.', 'tests', 'dummy', 'app', 'node_modules', 'foreign-package', '.jshintrc'),
path.join('.', 'tests', 'dummy', 'app', 'dist', '.jshintrc')
];

td.when(prompt(td.matchers.anything())).thenResolve({ deleteFiles: 'all' });

return emberNew()
.then(function() {
foreignJshintrcPaths.forEach(function(foreignJshintrcPath) {
fs.ensureFileSync(foreignJshintrcPath);
});
})
.then(function() {
return emberGenerate(args);
})
.then(function() {
foreignJshintrcPaths.forEach(function(foreignJshintrcPath) {
expect(file(foreignJshintrcPath)).to.exist;
});
});
});

it('does not remove any files if it shouldn\'t', function() {
var args = ['ember-cli-eslint', 'foo'];

Expand Down

0 comments on commit 341f4ec

Please sign in to comment.