Skip to content

Commit 131cbea

Browse files
committed
use new vitest syntax
1 parent 0d56624 commit 131cbea

File tree

10 files changed

+257
-272
lines changed

10 files changed

+257
-272
lines changed

packages/cli/src/codegen/schema.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const testEntity = async (generatedTypes: any[], expectedEntity: any) => {
3838
expect(methods.length).toBe(expectedEntity.methods.length);
3939
};
4040

41-
describe.concurrent('Schema code generator', () => {
41+
describe('Schema code generator', { concurrent: true }, () => {
4242
test('Should generate nothing for non entity types', () => {
4343
const codegen = createSchemaCodeGen(`
4444
type Foo {
@@ -217,7 +217,7 @@ describe.concurrent('Schema code generator', () => {
217217
return 0
218218
} else {
219219
return value.toI32()
220-
}
220+
}
221221
`,
222222
},
223223
{
@@ -313,7 +313,7 @@ describe.concurrent('Schema code generator', () => {
313313
params: [],
314314
returnType: new NamedType('WalletLoader'),
315315
body: `
316-
return new WalletLoader("Account", this.get('id')!.toString(), "wallets")
316+
return new WalletLoader("Account", this.get('id')!.toString(), "wallets")
317317
`,
318318
},
319319
],
@@ -566,7 +566,7 @@ describe.concurrent('Schema code generator', () => {
566566
id: Bytes!
567567
related: [RelatedBytes!]! @derivedFrom(field: "related")
568568
}
569-
569+
570570
type RelatedBytes @entity {
571571
id: ID!
572572
related: WithBytes!
@@ -647,17 +647,17 @@ describe.concurrent('Schema code generator', () => {
647647
test('no derived loader for interface', () => {
648648
const codegen = createSchemaCodeGen(`
649649
interface IExample {
650-
id: ID!
650+
id: ID!
651651
main: Main!
652652
num: Int!
653653
}
654-
654+
655655
type Example1 implements IExample @entity {
656-
id: ID!
656+
id: ID!
657657
main: Main!
658658
num: Int!
659659
}
660-
660+
661661
type Main @entity {
662662
id: ID!
663663
examples: [IExample!]! @derivedFrom(field: "main")

packages/cli/src/codegen/types/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { describe, expect, test } from 'vitest';
22
import * as codegen from './index.js';
33

4-
describe.concurrent('ethereum.Value -> AssemblyScript', () => {
4+
describe('ethereum.Value -> AssemblyScript', { concurrent: true }, () => {
55
// Scalar values
66

77
test('address -> Address', () => {

packages/cli/src/codegen/util.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { describe, expect, test } from 'vitest';
22
import { disambiguateNames, unrollTuple } from './util.js';
33

4-
describe.concurrent('Codegen utilities', () => {
4+
describe('Codegen utilities', { concurrent: true }, () => {
55
test('Name disambiguation', () => {
66
expect(
77
disambiguateNames({

packages/cli/src/command-helpers/compiler.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { describe, expect, it } from 'vitest';
22
import { appendApiVersionForGraph } from './compiler.js';
33

4-
describe.concurrent('appendApiVersionForGraph', () => {
4+
describe('appendApiVersionForGraph', { concurrent: true }, () => {
55
it('append /api/v0 to Prod URL with trailing slash', () => {
66
expect(appendApiVersionForGraph('https://api.thegraph.com/ipfs/')).toBe(
77
'https://api.thegraph.com/ipfs/api/v0',

packages/cli/src/command-helpers/contracts.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const TEST_CONTRACT_START_BLOCKS = {
8585
// },
8686
};
8787

88-
describe.sequential('getStartBlockForContract', async () => {
88+
describe('getStartBlockForContract', { sequential: true }, async () => {
8989
const registry = await loadRegistry();
9090
const contractService = new ContractService(registry);
9191
for (const [network, contracts] of Object.entries(TEST_CONTRACT_START_BLOCKS)) {

packages/cli/src/command-helpers/version.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as loadManifestUtils from '../migrations/util/load-manifest.js';
33
import * as graphTsUtil from '../migrations/util/versions.js';
44
import { assertGraphTsVersion, assertManifestApiVersion } from './version.js';
55

6-
describe.concurrent('Version Command Helpers', () => {
6+
describe('Version Command Helpers', { concurrent: true }, () => {
77
beforeEach(() => {
88
vi.resetModules();
99
});

packages/cli/src/protocols/ethereum/codegen/abi.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ let tempdir: string;
88
let abi: ABI;
99
let generatedTypes: any[] = [];
1010

11-
describe.concurrent('ABI code generation', () => {
11+
describe('ABI code generation', { concurrent: true }, () => {
1212
beforeAll(async () => {
1313
tempdir = await fs.mkdtemp('abi-codegen');
1414

packages/cli/src/validation/schema.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { describe, expect, test } from 'vitest';
22
import { typeSuggestion } from './schema.js';
33

4-
describe.concurrent('Schema validation', () => {
4+
describe('Schema validation', { concurrent: true }, () => {
55
test('Type suggestions', () => {
66
expect(typeSuggestion('Address')).toEqual('Bytes');
77
expect(typeSuggestion('address')).toEqual('Bytes');

packages/cli/tests/cli/init.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ import { cliTest } from './util';
44

55
// we run the tests sequentially because each init command installs deps with the
66
// same package manager and we want to avoid race conditions on the deps cache
7-
describe.sequential(
7+
describe(
88
'Init',
9+
{
10+
sequential: true,
11+
timeout: 100_000,
12+
},
913
() => {
1014
const baseDir = path.join(__dirname, 'init');
1115

@@ -238,7 +242,4 @@ describe.sequential(
238242
);
239243
});
240244
},
241-
{
242-
timeout: 60_000,
243-
},
244245
);

0 commit comments

Comments
 (0)