Skip to content

Commit

Permalink
fix: minor race condition bugs (wix#2335)
Browse files Browse the repository at this point in the history
  • Loading branch information
noomorph authored Sep 17, 2020
1 parent 61f2d6a commit d6ba881
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion detox/runners/jest/DetoxAdapterImpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ class DetoxAdapterImpl {
throw new DetoxRuntimeError(this._describeInitError());
}

const currentTest = this._currentTest;

await this._flush();
await this.detox.beforeEach(this._currentTest);
await this.detox.beforeEach(currentTest);
}

async afterAll() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ class WholeTestRecorderPlugin extends ArtifactPlugin {
await super.onTestDone(testSummary);

if (this.testRecording) {
await this.testRecording.stop();
const testRecording = this.testRecording;
await testRecording.stop();

if (this.shouldKeepArtifactOfTest(testSummary)) {
this._startSavingTestRecording(this.testRecording, testSummary)
this._startSavingTestRecording(testRecording, testSummary)
} else {
this._startDiscardingTestRecording(this.testRecording);
this._startDiscardingTestRecording(testRecording);
}

this.testRecording = null;
Expand Down

0 comments on commit d6ba881

Please sign in to comment.