test: the test suite exits on its own, without --forceExit (closes #585)
Some tests left timers running when they ended, and --forceExit hid them. - Six background test files leave an approval pending, so the background's 20-second timer ran forever. Each file now stubs that timer, as two blocks in tests/backgroundApproval.test.js already did. - Five popup test files show a flash message, and its timer outlived the test. They now run on fake timers. Both test scripts in package.json drop --forceExit. Model: opus-5-5
This commit is contained in:
@@ -357,6 +357,11 @@ describe("every way to a signature or the private key refuses a defective wallet
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
// showFlash() starts a timer that clears the message two seconds
|
||||
// later. Each test here runs on fake timers and drops them in
|
||||
// afterEach, so that timer never outlives the test.
|
||||
jest.useFakeTimers();
|
||||
|
||||
const broken = brokenXprvWallet();
|
||||
// A balance, so that no Send button's zero-balance refusal can stand
|
||||
// in for the defect check.
|
||||
@@ -398,6 +403,7 @@ describe("every way to a signature or the private key refuses a defective wallet
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.useRealTimers();
|
||||
state.wallets = [];
|
||||
state.activeAddress = null;
|
||||
state.selectedWallet = null;
|
||||
|
||||
Reference in New Issue
Block a user