-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix!:
launchNode.cleanup
not killing node in last test of test group (
- Loading branch information
Showing
9 changed files
with
237 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@fuel-ts/account": minor | ||
"fuels": minor | ||
--- | ||
|
||
fix!: `launchNode.cleanup` not killing node in last test of test group |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
packages/account/src/test-utils/launchNode-singular-test.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { launchNode } from './launchNode'; | ||
|
||
/** | ||
* The test runner creates a test environment per file, | ||
* which we can use to isolate the faulty behavior. | ||
*/ | ||
/** | ||
* @group node | ||
*/ | ||
describe('launchNode-singular-test', () => { | ||
const killedNode = { | ||
url: '', | ||
}; | ||
afterEach(async () => { | ||
await expect(fetch(killedNode.url)).rejects.toThrow('fetch failed'); | ||
}); | ||
test('synchronous cleanup kills node before test runner exits', async () => { | ||
const { cleanup, url } = await launchNode({ loggingEnabled: false }); | ||
killedNode.url = url; | ||
cleanup(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.