Skip to content

Commit 511945e

Browse files
committed
test/integration: add missing await in goDebugConfiguration tests
Change-Id: Ie8caceacd499e5837950a593ca71bfe33181a547 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/370475 Trust: Hyang-Ah Hana Kim <[email protected]> Run-TryBot: Hyang-Ah Hana Kim <[email protected]> Reviewed-by: Polina Sokolova <[email protected]>
1 parent 27bcdca commit 511945e

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

test/integration/goDebugConfiguration.test.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ suite('Debug Configuration Modify User Config', () => {
445445
assert.strictEqual(got.removed, tc.want.removed, `removed for ${tc.input} does not match expected`);
446446
});
447447
});
448-
test('remove user set -gcflags in buildFlags', () => {
448+
test('remove user set -gcflags in buildFlags', async () => {
449449
const config = {
450450
name: 'Launch',
451451
type: 'go',
@@ -456,10 +456,10 @@ suite('Debug Configuration Modify User Config', () => {
456456
buildFlags: '-race -gcflags=-l -mod=mod'
457457
};
458458

459-
debugConfigProvider.resolveDebugConfiguration(undefined, config);
459+
await debugConfigProvider.resolveDebugConfiguration(undefined, config);
460460
assert.strictEqual(config.buildFlags, '-race -mod=mod');
461461
});
462-
test('remove user set -gcflags in GOFLAGS', () => {
462+
test('remove user set -gcflags in GOFLAGS', async () => {
463463
const config = {
464464
name: 'Launch',
465465
type: 'go',
@@ -469,7 +469,7 @@ suite('Debug Configuration Modify User Config', () => {
469469
env: { GOFLAGS: '-race -gcflags=-l -mod=mod' }
470470
};
471471

472-
debugConfigProvider.resolveDebugConfiguration(undefined, config);
472+
await debugConfigProvider.resolveDebugConfiguration(undefined, config);
473473

474474
assert.strictEqual(config.env.GOFLAGS, '-race -mod=mod');
475475
});
@@ -478,7 +478,7 @@ suite('Debug Configuration Modify User Config', () => {
478478

479479
suite('Debug Configuration Resolve Paths', () => {
480480
const debugConfigProvider = new GoDebugConfigurationProvider();
481-
test('resolve ~ in cwd', () => {
481+
test('resolve ~ in cwd', async () => {
482482
const config = {
483483
name: 'Launch',
484484
type: 'go',
@@ -488,11 +488,11 @@ suite('Debug Configuration Resolve Paths', () => {
488488
cwd: '~/main.go'
489489
};
490490

491-
debugConfigProvider.resolveDebugConfiguration(undefined, config);
491+
await debugConfigProvider.resolveDebugConfiguration(undefined, config);
492492
assert.notStrictEqual(config.cwd, '~/main.go');
493493
});
494494

495-
test('do not resolve workspaceFolder or fileDirname', () => {
495+
test('do not resolve workspaceFolder or fileDirname', async () => {
496496
const config = {
497497
name: 'Launch',
498498
type: 'go',
@@ -502,7 +502,7 @@ suite('Debug Configuration Resolve Paths', () => {
502502
cwd: '${workspaceFolder}'
503503
};
504504

505-
debugConfigProvider.resolveDebugConfiguration(undefined, config);
505+
await debugConfigProvider.resolveDebugConfiguration(undefined, config);
506506

507507
assert.strictEqual(config.cwd, '${workspaceFolder}');
508508
assert.strictEqual(config.program, '${fileDirname}');
@@ -842,7 +842,7 @@ suite('Debug Configuration Converts Relative Paths', () => {
842842

843843
suite('Debug Configuration Auto Mode', () => {
844844
const debugConfigProvider = new GoDebugConfigurationProvider();
845-
test('resolve auto to debug with non-test file', () => {
845+
test('resolve auto to debug with non-test file', async () => {
846846
const config = {
847847
name: 'Launch',
848848
type: 'go',
@@ -851,12 +851,12 @@ suite('Debug Configuration Auto Mode', () => {
851851
program: '/path/to/main.go'
852852
};
853853

854-
debugConfigProvider.resolveDebugConfiguration(undefined, config);
854+
await debugConfigProvider.resolveDebugConfiguration(undefined, config);
855855
assert.strictEqual(config.mode, 'debug');
856856
assert.strictEqual(config.program, '/path/to/main.go');
857857
});
858858

859-
test('resolve auto to debug with test file', () => {
859+
test('resolve auto to debug with test file', async () => {
860860
const config = {
861861
name: 'Launch',
862862
type: 'go',
@@ -865,15 +865,15 @@ suite('Debug Configuration Auto Mode', () => {
865865
program: '/path/to/main_test.go'
866866
};
867867

868-
debugConfigProvider.resolveDebugConfiguration(undefined, config);
868+
await debugConfigProvider.resolveDebugConfiguration(undefined, config);
869869
assert.strictEqual(config.mode, 'test');
870870
assert.strictEqual(config.program, '/path/to');
871871
});
872872
});
873873

874874
suite('Debug Configuration Default DebugAdapter', () => {
875875
const debugConfigProvider = new GoDebugConfigurationProvider();
876-
test("default debugAdapter should be 'dlv-dap'", () => {
876+
test("default debugAdapter should be 'dlv-dap'", async () => {
877877
const config = {
878878
name: 'Launch',
879879
type: 'go',
@@ -882,12 +882,12 @@ suite('Debug Configuration Default DebugAdapter', () => {
882882
program: '/path/to/main.go'
883883
};
884884

885-
debugConfigProvider.resolveDebugConfiguration(undefined, config);
885+
await debugConfigProvider.resolveDebugConfiguration(undefined, config);
886886
const resolvedConfig = config as any;
887887
assert.strictEqual(resolvedConfig['debugAdapter'], 'dlv-dap');
888888
});
889889

890-
test("default debugAdapter for remote mode should be always 'legacy'", () => {
890+
test("default debugAdapter for remote mode should be always 'legacy'", async () => {
891891
const config = {
892892
name: 'Attach',
893893
type: 'go',
@@ -898,12 +898,12 @@ suite('Debug Configuration Default DebugAdapter', () => {
898898
};
899899

900900
const want = 'legacy'; // Remote mode defaults to legacy mode.
901-
debugConfigProvider.resolveDebugConfiguration(undefined, config);
901+
await debugConfigProvider.resolveDebugConfiguration(undefined, config);
902902
const resolvedConfig = config as any;
903903
assert.strictEqual(resolvedConfig['debugAdapter'], want);
904904
});
905905

906-
test('debugAdapter=dlv-dap is allowed with remote mode', () => {
906+
test('debugAdapter=dlv-dap is allowed with remote mode', async () => {
907907
const config = {
908908
name: 'Attach',
909909
type: 'go',
@@ -915,7 +915,7 @@ suite('Debug Configuration Default DebugAdapter', () => {
915915
};
916916

917917
const want = 'dlv-dap'; // If requested, dlv-dap is preserved.
918-
debugConfigProvider.resolveDebugConfiguration(undefined, config);
918+
await debugConfigProvider.resolveDebugConfiguration(undefined, config);
919919
const resolvedConfig = config as any;
920920
assert.strictEqual(resolvedConfig['debugAdapter'], want);
921921
});

0 commit comments

Comments
 (0)