Skip to content

Commit

Permalink
fix: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
belopash committed Sep 8, 2024
1 parent bad1b04 commit 3d6e68c
Showing 1 changed file with 36 additions and 14 deletions.
50 changes: 36 additions & 14 deletions test/squid_name.test.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { Manifest, ManifestParsingError } from '../src';

describe('Squid name', () => {
it('should require squid name and version', () => {
const { error } = Manifest.parse(`
manifest_version: subsquid.io/v0.1
build:
deploy:
api:
cmd: [ "npx", "squid-graphql-server" ]
processor:
cmd: [ "node", "lib/processor" ]
`);
// it('should require squid name and version', () => {
// const { error } = Manifest.parse(`
// manifest_version: subsquid.io/v0.1
// build:
// deploy:
// api:
// cmd: [ "npx", "squid-graphql-server" ]
// processor:
// cmd: [ "node", "lib/processor" ]
// `);

expect(error).toEqual(
new ManifestParsingError(['The squid name is required', 'The squid version is required']),
);
});
// expect(error).toEqual(
// new ManifestParsingError(['The squid name is required', 'The squid version is required']),
// );
// });

it('should convert squid name as number to a string', () => {
const { value } = Manifest.parse(`
Expand Down Expand Up @@ -131,4 +131,26 @@ describe('Squid name', () => {
]),
);
});

it('should allow only one of slot, tag, version', () => {
const { error } = Manifest.parse(`
manifest_version: subsquid.io/v0.1
name: test
slot: v1
version: 1
tag: dev
build:
deploy:
api:
cmd: [ "npx", "squid-graphql-server" ]
processor:
cmd: [ "node", "lib/processor" ]
`);

expect(error).toEqual(
new ManifestParsingError([
'"value" contains a conflict between optional exclusive peers [slot, version, tag]',
]),
);
});
});

0 comments on commit 3d6e68c

Please sign in to comment.