Skip to content

Commit 68b12b5

Browse files
Tests cleanup (#1886)
* allow running tests workflows from forks * remove unused snapshots * use new vitest syntax
1 parent 75e76fa commit 68b12b5

File tree

12 files changed

+258
-753
lines changed

12 files changed

+258
-753
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
push:
66
branches:
77
- 'main'
8-
pull_request:
8+
pull_request_target:
99

1010
jobs:
1111
lint:

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
});

0 commit comments

Comments
 (0)