Skip to content

Commit c7d9988

Browse files
committed
Use finally to make test cleanup unconditional
1 parent c7410ae commit c7d9988

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/test.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,10 @@ describe('Filter', function() {
238238
expect(existsSync(results.directory + '/a/README.md'), 'OUTPUT: a/foo.js should NO LONGER be present').to.be.false;
239239

240240
expect(existsSync(fileForRemoval)).to.be.false;
241+
return results;
242+
}).finally(function() {
241243
fs.writeFileSync(fileForRemoval, 'Nicest cats in need of homes');
244+
}).then(function(results) {
242245
expect(existsSync(fileForRemoval)).to.be.true;
243246

244247
return results.builder();
@@ -312,7 +315,7 @@ describe('Filter', function() {
312315
to.equal('utf8');
313316
});
314317

315-
describe('proccesFile', function() {
318+
describe('processFile', function() {
316319
beforeEach(function() {
317320
sinon.spy(fs, 'mkdirSync');
318321
});

0 commit comments

Comments
 (0)