Skip to content

Commit 2500c23

Browse files
author
Robert Jackson
committed
Fix test using Promise.prototype.finally in Node 8.
1 parent ec02ca6 commit 2500c23

1 file changed

Lines changed: 16 additions & 12 deletions

File tree

test/fastboot-test.js

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -363,28 +363,32 @@ describe('FastBoot', function() {
363363
.then(html => expect(html).to.match(/Welcome to Ember/));
364364
});
365365

366-
it('reloads the config when package.json changes', function() {
366+
it('reloads the config when package.json changes', async function() {
367367
var distPath = fixture('config-swap-app');
368368
var packagePath = path.join(distPath, 'package.json');
369369
var package1Path = path.join(distPath, 'package-1.json');
370370
var package2Path = path.join(distPath, 'package-2.json');
371371

372372
copyPackage(package1Path);
373+
373374
var fastboot = new FastBoot({
374375
distPath: distPath,
375376
});
376377

377-
return fastboot
378-
.visit('/')
379-
.then(r => r.html())
380-
.then(html => expect(html).to.match(/Config foo: bar/))
381-
.then(() => deletePackage())
382-
.then(() => copyPackage(package2Path))
383-
.then(hotReloadApp)
384-
.then(() => fastboot.visit('/'))
385-
.then(r => r.html())
386-
.then(html => expect(html).to.match(/Config foo: boo/))
387-
.finally(() => deletePackage());
378+
try {
379+
await fastboot
380+
.visit('/')
381+
.then(r => r.html())
382+
.then(html => expect(html).to.match(/Config foo: bar/))
383+
.then(() => deletePackage())
384+
.then(() => copyPackage(package2Path))
385+
.then(hotReloadApp)
386+
.then(() => fastboot.visit('/'))
387+
.then(r => r.html())
388+
.then(html => expect(html).to.match(/Config foo: boo/));
389+
} finally {
390+
deletePackage();
391+
}
388392

389393
function hotReloadApp() {
390394
fastboot.reload({

0 commit comments

Comments
 (0)