Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debt - properly await runWithFakedTimers #192887

Merged
merged 3 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ suite('ResourceWorkingCopy', function () {
});

test('orphaned tracking', async () => {
runWithFakedTimers({}, async () => {
return runWithFakedTimers({}, async () => {
assert.strictEqual(workingCopy.isOrphaned(), false);

let onDidChangeOrphanedPromise = Event.toPromise(workingCopy.onDidChangeOrphaned);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ suite('StoredFileWorkingCopy', function () {
});

test('orphaned tracking', async () => {
runWithFakedTimers({}, async () => {
return runWithFakedTimers({}, async () => {
assert.strictEqual(workingCopy.hasState(StoredFileWorkingCopyState.ORPHAN), false);

let onDidChangeOrphanedPromise = Event.toPromise(workingCopy.onDidChangeOrphaned);
Expand Down Expand Up @@ -411,7 +411,7 @@ suite('StoredFileWorkingCopy', function () {
});

test('resolve (with backup, preserves metadata and orphaned state)', async () => {
runWithFakedTimers({}, async () => {
return runWithFakedTimers({}, async () => {
await workingCopy.resolve({ contents: bufferToStream(VSBuffer.fromString('hello backup')) });

const orphanedPromise = Event.toPromise(workingCopy.onDidChangeOrphaned);
Expand Down Expand Up @@ -440,7 +440,7 @@ suite('StoredFileWorkingCopy', function () {
});

test('resolve (updates orphaned state accordingly)', async () => {
runWithFakedTimers({}, async () => {
return runWithFakedTimers({}, async () => {
await workingCopy.resolve();

const orphanedPromise = Event.toPromise(workingCopy.onDidChangeOrphaned);
Expand Down Expand Up @@ -694,7 +694,7 @@ suite('StoredFileWorkingCopy', function () {
});

test('save (no errors) - save clears orphaned', async () => {
runWithFakedTimers({}, async () => {
return runWithFakedTimers({}, async () => {
let savedCounter = 0;
disposables.add(workingCopy.onDidSave(e => {
savedCounter++;
Expand Down