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

Commit

Permalink
Tests: remove unstable generator test and re-enable it
Browse files Browse the repository at this point in the history
  • Loading branch information
markelog committed Apr 14, 2016
1 parent 86be5b5 commit a855828
Showing 1 changed file with 1 addition and 26 deletions.
27 changes: 1 addition & 26 deletions test/specs/config/generator.js
Expand Up @@ -10,7 +10,7 @@ var ConfigGenerator = require('../../../lib/config/generator');
var crockfordClone = require('../../data/configs/generator/crockfordClone');

// Skip it, to slow at the moment
describe.skip('lib/config/generator', function() {
describe('lib/config/generator', function() {
this.timeout(60000);

var _path = path.resolve(__dirname, '../../../lib/config/generator.js');
Expand Down Expand Up @@ -166,29 +166,4 @@ describe.skip('lib/config/generator', function() {
done();
});
});

it('generates a .jscsrc file with the user\'s violation choices', function() {
stubConsole();
var presetChoiceStub = sinon.stub(generator, '_getUserPresetChoice').returns(crockfordPresetChoice);
var getViolationsStub = sinon.stub(generator, '_getUserViolationChoices')
.returns(Vow.cast(crockfordViolationsAllExceptions));
var fsStub = sinon.stub(fs, 'writeFileSync');

var assertConfigEquality = function(c1, c2) {
for (var prop in c1) {
expect(c1[prop]).to.equal(c2[prop]);
}
};

return generator.generate(_path).then(function() {
var configPath = fsStub.getCall(0).args[0];
var config = JSON.parse(fsStub.getCall(0).args[1]);
expect(configPath).to.equal(process.cwd() + '/.jscsrc');
assertConfigEquality(expectedConfig, config);
presetChoiceStub.restore();
getViolationsStub.restore();
fsStub.restore();
unstubConsole();
});
});
});

0 comments on commit a855828

Please sign in to comment.