diff --git a/packages/nodes-from-anchor/test/v01/AccountNode.test.ts b/packages/nodes-from-anchor/test/v01/AccountNode.test.ts index 8d18a00e..399be4d5 100644 --- a/packages/nodes-from-anchor/test/v01/AccountNode.test.ts +++ b/packages/nodes-from-anchor/test/v01/AccountNode.test.ts @@ -6,11 +6,11 @@ import { structFieldTypeNode, structTypeNode, } from '@kinobi-so/nodes'; -import test from 'ava'; +import { expect, test } from 'vitest'; import { accountNodeFromAnchorV01, getAnchorDiscriminatorV01 } from '../../src/index.js'; -test('it creates account nodes with anchor discriminators', t => { +test('it creates account nodes with anchor discriminators', () => { const node = accountNodeFromAnchorV01( { discriminator: [246, 28, 6, 87, 251, 45, 50, 42], @@ -33,8 +33,7 @@ test('it creates account nodes with anchor discriminators', t => { ], ); - t.deepEqual( - node, + expect(node).toEqual( accountNode({ data: structTypeNode([ structFieldTypeNode({ diff --git a/packages/nodes-from-anchor/test/v01/DefinedTypeNode.test.ts b/packages/nodes-from-anchor/test/v01/DefinedTypeNode.test.ts index a4004e5b..25950c63 100644 --- a/packages/nodes-from-anchor/test/v01/DefinedTypeNode.test.ts +++ b/packages/nodes-from-anchor/test/v01/DefinedTypeNode.test.ts @@ -1,9 +1,9 @@ import { definedTypeNode, numberTypeNode, structFieldTypeNode, structTypeNode } from '@kinobi-so/nodes'; -import test from 'ava'; +import { expect, test } from 'vitest'; import { definedTypeNodeFromAnchorV01 } from '../../src/index.js'; -test('it creates defined type nodes', t => { +test('it creates defined type nodes', () => { const node = definedTypeNodeFromAnchorV01({ name: 'MyType', type: { @@ -12,8 +12,7 @@ test('it creates defined type nodes', t => { }, }); - t.deepEqual( - node, + expect(node).toEqual( definedTypeNode({ name: 'myType', type: structTypeNode([ diff --git a/packages/nodes-from-anchor/test/v01/ErrorNode.test.ts b/packages/nodes-from-anchor/test/v01/ErrorNode.test.ts index f6b467ff..75ccdef6 100644 --- a/packages/nodes-from-anchor/test/v01/ErrorNode.test.ts +++ b/packages/nodes-from-anchor/test/v01/ErrorNode.test.ts @@ -1,17 +1,16 @@ import { errorNode } from '@kinobi-so/nodes'; -import test from 'ava'; +import { expect, test } from 'vitest'; import { errorNodeFromAnchorV01 } from '../../src/index.js'; -test('it creates error nodes', t => { +test('it creates error nodes', () => { const node = errorNodeFromAnchorV01({ code: 42, msg: 'my error message', name: 'myError', }); - t.deepEqual( - node, + expect(node).toEqual( errorNode({ code: 42, docs: ['myError: my error message'], diff --git a/packages/nodes-from-anchor/test/v01/InstructionAccountNode.test.ts b/packages/nodes-from-anchor/test/v01/InstructionAccountNode.test.ts index 03d5e62f..7e6c2c62 100644 --- a/packages/nodes-from-anchor/test/v01/InstructionAccountNode.test.ts +++ b/packages/nodes-from-anchor/test/v01/InstructionAccountNode.test.ts @@ -1,9 +1,9 @@ import { instructionAccountNode, publicKeyValueNode } from '@kinobi-so/nodes'; -import test from 'ava'; +import { expect, test } from 'vitest'; import { instructionAccountNodeFromAnchorV01, instructionAccountNodesFromAnchorV01 } from '../../src/index.js'; -test('it creates instruction account nodes', t => { +test('it creates instruction account nodes', () => { const node = instructionAccountNodeFromAnchorV01({ docs: ['my docs'], name: 'MyInstructionAccount', @@ -12,8 +12,7 @@ test('it creates instruction account nodes', t => { writable: true, }); - t.deepEqual( - node, + expect(node).toEqual( instructionAccountNode({ docs: ['my docs'], isOptional: true, @@ -24,7 +23,7 @@ test('it creates instruction account nodes', t => { ); }); -test('it flattens nested instruction accounts', t => { +test('it flattens nested instruction accounts', () => { const nodes = instructionAccountNodesFromAnchorV01([ { name: 'accountA', signer: false, writable: false }, { @@ -49,7 +48,7 @@ test('it flattens nested instruction accounts', t => { { name: 'account_d', signer: true, writable: true }, ]); - t.deepEqual(nodes, [ + expect(nodes).toEqual([ instructionAccountNode({ isSigner: false, isWritable: false, name: 'accountA' }), instructionAccountNode({ isSigner: false, isWritable: true, name: 'accountB' }), instructionAccountNode({ isSigner: true, isWritable: false, name: 'accountC' }), diff --git a/packages/nodes-from-anchor/test/v01/InstructionArgumentNode.test.ts b/packages/nodes-from-anchor/test/v01/InstructionArgumentNode.test.ts index efe9acbb..06b50e11 100644 --- a/packages/nodes-from-anchor/test/v01/InstructionArgumentNode.test.ts +++ b/packages/nodes-from-anchor/test/v01/InstructionArgumentNode.test.ts @@ -1,16 +1,15 @@ import { instructionArgumentNode, numberTypeNode } from '@kinobi-so/nodes'; -import test from 'ava'; +import { expect, test } from 'vitest'; import { instructionArgumentNodeFromAnchorV01 } from '../../src/index.js'; -test('it creates instruction argument nodes', t => { +test('it creates instruction argument nodes', () => { const node = instructionArgumentNodeFromAnchorV01({ name: 'my_instruction_argument', type: 'u8', }); - t.deepEqual( - node, + expect(node).toEqual( instructionArgumentNode({ name: 'myInstructionArgument', type: numberTypeNode('u8'), diff --git a/packages/nodes-from-anchor/test/v01/InstructionNode.test.ts b/packages/nodes-from-anchor/test/v01/InstructionNode.test.ts index 758a9103..bb8ca54d 100644 --- a/packages/nodes-from-anchor/test/v01/InstructionNode.test.ts +++ b/packages/nodes-from-anchor/test/v01/InstructionNode.test.ts @@ -6,12 +6,12 @@ import { instructionNode, numberTypeNode, } from '@kinobi-so/nodes'; -import test from 'ava'; +import { expect, test } from 'vitest'; import { instructionNodeFromAnchorV01 } from '../../src/index.js'; import { getAnchorDiscriminatorV01 } from '../../src/index.js'; -test('it creates instruction nodes', t => { +test('it creates instruction nodes', () => { const node = instructionNodeFromAnchorV01({ accounts: [{ name: 'Mint', signer: false, writable: true }], args: [{ name: 'amount', type: 'u8' }], @@ -19,8 +19,7 @@ test('it creates instruction nodes', t => { name: 'mintTokens', }); - t.deepEqual( - node, + expect(node).toEqual( instructionNode({ accounts: [instructionAccountNode({ isSigner: false, isWritable: true, name: 'mint' })], arguments: [ @@ -38,7 +37,7 @@ test('it creates instruction nodes', t => { ); }); -test('it creates instruction nodes with anchor discriminators', t => { +test('it creates instruction nodes with anchor discriminators', () => { const node = instructionNodeFromAnchorV01({ accounts: [], args: [], @@ -46,8 +45,7 @@ test('it creates instruction nodes with anchor discriminators', t => { name: 'myInstruction', }); - t.deepEqual( - node, + expect(node).toEqual( instructionNode({ arguments: [ instructionArgumentNode({ diff --git a/packages/nodes-from-anchor/test/v01/PdaNode.test.ts b/packages/nodes-from-anchor/test/v01/PdaNode.test.ts index 2a62232a..3cd1e21b 100644 --- a/packages/nodes-from-anchor/test/v01/PdaNode.test.ts +++ b/packages/nodes-from-anchor/test/v01/PdaNode.test.ts @@ -1,9 +1,9 @@ import { bytesTypeNode, constantPdaSeedNode, pdaNode, publicKeyTypeNode, variablePdaSeedNode } from '@kinobi-so/nodes'; -import test from 'ava'; +import { expect, test } from 'vitest'; import { getAnchorDiscriminatorV01, pdaNodeFromAnchorV01 } from '../../src/index.js'; -test('it creates PDA nodes', t => { +test('it creates PDA nodes', () => { const node = pdaNodeFromAnchorV01({ name: 'myPda', pda: { @@ -14,8 +14,7 @@ test('it creates PDA nodes', t => { }, }); - t.deepEqual( - node, + expect(node).toEqual( pdaNode({ name: 'myPda', seeds: [ diff --git a/packages/nodes-from-anchor/test/v01/ProgramNode.test.ts b/packages/nodes-from-anchor/test/v01/ProgramNode.test.ts index 9f75253f..ca6c6d28 100644 --- a/packages/nodes-from-anchor/test/v01/ProgramNode.test.ts +++ b/packages/nodes-from-anchor/test/v01/ProgramNode.test.ts @@ -15,11 +15,11 @@ import { structTypeNode, variablePdaSeedNode, } from '@kinobi-so/nodes'; -import test from 'ava'; +import { expect, test } from 'vitest'; import { getAnchorDiscriminatorV01, programNodeFromAnchorV01 } from '../../src/index.js'; -test('it creates program nodes', t => { +test('it creates program nodes', () => { const node = programNodeFromAnchorV01({ accounts: [{ discriminator: [246, 28, 6, 87, 251, 45, 50, 42], name: 'MyAccount' }], address: '1111', @@ -46,8 +46,7 @@ test('it creates program nodes', t => { types: [{ name: 'MyAccount', type: { fields: [], kind: 'struct' } }], }); - t.deepEqual( - node, + expect(node).toEqual( programNode({ accounts: [ accountNode({ diff --git a/packages/nodes-from-anchor/test/v01/RootNode.test.ts b/packages/nodes-from-anchor/test/v01/RootNode.test.ts index a390f566..2faffbb9 100644 --- a/packages/nodes-from-anchor/test/v01/RootNode.test.ts +++ b/packages/nodes-from-anchor/test/v01/RootNode.test.ts @@ -1,9 +1,9 @@ import { programNode, rootNode } from '@kinobi-so/nodes'; -import test from 'ava'; +import { expect, test } from 'vitest'; import { rootNodeFromAnchorV01 } from '../../src/index.js'; -test('it creates root nodes', t => { +test('it creates root nodes', () => { const node = rootNodeFromAnchorV01({ address: '1111', instructions: [], @@ -14,8 +14,7 @@ test('it creates root nodes', t => { }, }); - t.deepEqual( - node, + expect(node).toEqual( rootNode( programNode({ name: 'myProgram', diff --git a/packages/nodes-from-anchor/test/v01/typeNodes/ArrayTypeNode.test.ts b/packages/nodes-from-anchor/test/v01/typeNodes/ArrayTypeNode.test.ts index f5f960c5..aeae49aa 100644 --- a/packages/nodes-from-anchor/test/v01/typeNodes/ArrayTypeNode.test.ts +++ b/packages/nodes-from-anchor/test/v01/typeNodes/ArrayTypeNode.test.ts @@ -1,12 +1,11 @@ import { arrayTypeNode, fixedCountNode, numberTypeNode, prefixedCountNode } from '@kinobi-so/nodes'; -import test from 'ava'; +import { expect, test } from 'vitest'; import { typeNodeFromAnchorV01 } from '../../../src/index.js'; -test('it creates array type nodes', t => { - t.deepEqual(typeNodeFromAnchorV01({ array: ['u8', 2] }), arrayTypeNode(numberTypeNode('u8'), fixedCountNode(2))); - t.deepEqual( - typeNodeFromAnchorV01({ vec: 'u8' }), +test('it creates array type nodes', () => { + expect(typeNodeFromAnchorV01({ array: ['u8', 2] })).toEqual(arrayTypeNode(numberTypeNode('u8'), fixedCountNode(2))); + expect(typeNodeFromAnchorV01({ vec: 'u8' })).toEqual( arrayTypeNode(numberTypeNode('u8'), prefixedCountNode(numberTypeNode('u32'))), ); }); diff --git a/packages/nodes-from-anchor/test/v01/typeNodes/BooleanTypeNode.test.ts b/packages/nodes-from-anchor/test/v01/typeNodes/BooleanTypeNode.test.ts index a60b7e75..b9dbb52a 100644 --- a/packages/nodes-from-anchor/test/v01/typeNodes/BooleanTypeNode.test.ts +++ b/packages/nodes-from-anchor/test/v01/typeNodes/BooleanTypeNode.test.ts @@ -1,8 +1,8 @@ import { booleanTypeNode } from '@kinobi-so/nodes'; -import test from 'ava'; +import { expect, test } from 'vitest'; import { typeNodeFromAnchorV01 } from '../../../src/index.js'; -test('it creates boolean type nodes', t => { - t.deepEqual(typeNodeFromAnchorV01('bool'), booleanTypeNode()); +test('it creates boolean type nodes', () => { + expect(typeNodeFromAnchorV01('bool')).toEqual(booleanTypeNode()); }); diff --git a/packages/nodes-from-anchor/test/v01/typeNodes/BytesTypeNode.test.ts b/packages/nodes-from-anchor/test/v01/typeNodes/BytesTypeNode.test.ts index 176c4a8e..5c1528a1 100644 --- a/packages/nodes-from-anchor/test/v01/typeNodes/BytesTypeNode.test.ts +++ b/packages/nodes-from-anchor/test/v01/typeNodes/BytesTypeNode.test.ts @@ -1,8 +1,8 @@ import { bytesTypeNode, numberTypeNode, sizePrefixTypeNode } from '@kinobi-so/nodes'; -import test from 'ava'; +import { expect, test } from 'vitest'; import { typeNodeFromAnchorV01 } from '../../../src/index.js'; -test('it creates bytes type nodes', t => { - t.deepEqual(typeNodeFromAnchorV01('bytes'), sizePrefixTypeNode(bytesTypeNode(), numberTypeNode('u32'))); +test('it creates bytes type nodes', () => { + expect(typeNodeFromAnchorV01('bytes')).toEqual(sizePrefixTypeNode(bytesTypeNode(), numberTypeNode('u32'))); }); diff --git a/packages/nodes-from-anchor/test/v01/typeNodes/EnumTypeNode.test.ts b/packages/nodes-from-anchor/test/v01/typeNodes/EnumTypeNode.test.ts index 5d817008..3b133dba 100644 --- a/packages/nodes-from-anchor/test/v01/typeNodes/EnumTypeNode.test.ts +++ b/packages/nodes-from-anchor/test/v01/typeNodes/EnumTypeNode.test.ts @@ -9,11 +9,11 @@ import { structTypeNode, tupleTypeNode, } from '@kinobi-so/nodes'; -import test from 'ava'; +import { expect, test } from 'vitest'; import { typeNodeFromAnchorV01 } from '../../../src/index.js'; -test('it creates enum type nodes', t => { +test('it creates enum type nodes', () => { const node = typeNodeFromAnchorV01({ kind: 'enum', variants: [ @@ -23,8 +23,7 @@ test('it creates enum type nodes', t => { ], }); - t.deepEqual( - node, + expect(node).toEqual( enumTypeNode([ enumEmptyVariantTypeNode('variantA'), enumTupleVariantTypeNode('variantB', tupleTypeNode([numberTypeNode('u16'), booleanTypeNode()])), diff --git a/packages/nodes-from-anchor/test/v01/typeNodes/NumberTypeNode.test.ts b/packages/nodes-from-anchor/test/v01/typeNodes/NumberTypeNode.test.ts index abef80b1..f51716e4 100644 --- a/packages/nodes-from-anchor/test/v01/typeNodes/NumberTypeNode.test.ts +++ b/packages/nodes-from-anchor/test/v01/typeNodes/NumberTypeNode.test.ts @@ -1,20 +1,20 @@ import { numberTypeNode } from '@kinobi-so/nodes'; -import test from 'ava'; +import { expect, test } from 'vitest'; import { typeNodeFromAnchorV01 } from '../../../src/index.js'; -test('it creates number type nodes', t => { - t.deepEqual(typeNodeFromAnchorV01('f32'), numberTypeNode('f32')); - t.deepEqual(typeNodeFromAnchorV01('f64'), numberTypeNode('f64')); - t.deepEqual(typeNodeFromAnchorV01('i8'), numberTypeNode('i8')); - t.deepEqual(typeNodeFromAnchorV01('i16'), numberTypeNode('i16')); - t.deepEqual(typeNodeFromAnchorV01('i32'), numberTypeNode('i32')); - t.deepEqual(typeNodeFromAnchorV01('i64'), numberTypeNode('i64')); - t.deepEqual(typeNodeFromAnchorV01('i128'), numberTypeNode('i128')); - t.deepEqual(typeNodeFromAnchorV01('shortU16'), numberTypeNode('shortU16')); - t.deepEqual(typeNodeFromAnchorV01('u8'), numberTypeNode('u8')); - t.deepEqual(typeNodeFromAnchorV01('u16'), numberTypeNode('u16')); - t.deepEqual(typeNodeFromAnchorV01('u32'), numberTypeNode('u32')); - t.deepEqual(typeNodeFromAnchorV01('u64'), numberTypeNode('u64')); - t.deepEqual(typeNodeFromAnchorV01('u128'), numberTypeNode('u128')); +test('it creates number type nodes', () => { + expect(typeNodeFromAnchorV01('f32')).toEqual(numberTypeNode('f32')); + expect(typeNodeFromAnchorV01('f64')).toEqual(numberTypeNode('f64')); + expect(typeNodeFromAnchorV01('i8')).toEqual(numberTypeNode('i8')); + expect(typeNodeFromAnchorV01('i16')).toEqual(numberTypeNode('i16')); + expect(typeNodeFromAnchorV01('i32')).toEqual(numberTypeNode('i32')); + expect(typeNodeFromAnchorV01('i64')).toEqual(numberTypeNode('i64')); + expect(typeNodeFromAnchorV01('i128')).toEqual(numberTypeNode('i128')); + expect(typeNodeFromAnchorV01('shortU16')).toEqual(numberTypeNode('shortU16')); + expect(typeNodeFromAnchorV01('u8')).toEqual(numberTypeNode('u8')); + expect(typeNodeFromAnchorV01('u16')).toEqual(numberTypeNode('u16')); + expect(typeNodeFromAnchorV01('u32')).toEqual(numberTypeNode('u32')); + expect(typeNodeFromAnchorV01('u64')).toEqual(numberTypeNode('u64')); + expect(typeNodeFromAnchorV01('u128')).toEqual(numberTypeNode('u128')); }); diff --git a/packages/nodes-from-anchor/test/v01/typeNodes/OptionTypeNode.test.ts b/packages/nodes-from-anchor/test/v01/typeNodes/OptionTypeNode.test.ts index f755f0fd..6fd314a3 100644 --- a/packages/nodes-from-anchor/test/v01/typeNodes/OptionTypeNode.test.ts +++ b/packages/nodes-from-anchor/test/v01/typeNodes/OptionTypeNode.test.ts @@ -1,19 +1,17 @@ import { numberTypeNode, optionTypeNode } from '@kinobi-so/nodes'; -import test from 'ava'; +import { expect, test } from 'vitest'; import { typeNodeFromAnchorV01 } from '../../../src/index.js'; -test('it creates option type nodes', t => { - t.deepEqual(typeNodeFromAnchorV01({ option: 'u8' }), optionTypeNode(numberTypeNode('u8'))); +test('it creates option type nodes', () => { + expect(typeNodeFromAnchorV01({ option: 'u8' })).toEqual(optionTypeNode(numberTypeNode('u8'))); }); -test('it creates option type nodes with fixed size', t => { - t.deepEqual( - typeNodeFromAnchorV01({ coption: 'u8' }), +test('it creates option type nodes with fixed size', () => { + expect(typeNodeFromAnchorV01({ coption: 'u8' })).toEqual( optionTypeNode(numberTypeNode('u8'), { fixed: true, prefix: numberTypeNode('u32') }), ); - t.deepEqual( - typeNodeFromAnchorV01({ coption: 'u8' }), + expect(typeNodeFromAnchorV01({ coption: 'u8' })).toEqual( optionTypeNode(numberTypeNode('u8'), { fixed: true, prefix: numberTypeNode('u32') }), ); }); diff --git a/packages/nodes-from-anchor/test/v01/typeNodes/PublicKeyTypeNode.test.ts b/packages/nodes-from-anchor/test/v01/typeNodes/PublicKeyTypeNode.test.ts index 2c6e362a..2ca43a84 100644 --- a/packages/nodes-from-anchor/test/v01/typeNodes/PublicKeyTypeNode.test.ts +++ b/packages/nodes-from-anchor/test/v01/typeNodes/PublicKeyTypeNode.test.ts @@ -1,8 +1,8 @@ import { publicKeyTypeNode } from '@kinobi-so/nodes'; -import test from 'ava'; +import { expect, test } from 'vitest'; import { typeNodeFromAnchorV01 } from '../../../src/index.js'; -test('it creates public key type nodes', t => { - t.deepEqual(typeNodeFromAnchorV01('pubkey'), publicKeyTypeNode()); +test('it creates public key type nodes', () => { + expect(typeNodeFromAnchorV01('pubkey')).toEqual(publicKeyTypeNode()); }); diff --git a/packages/nodes-from-anchor/test/v01/typeNodes/StringTypeNode.test.ts b/packages/nodes-from-anchor/test/v01/typeNodes/StringTypeNode.test.ts index fa5c4d95..c668a7e5 100644 --- a/packages/nodes-from-anchor/test/v01/typeNodes/StringTypeNode.test.ts +++ b/packages/nodes-from-anchor/test/v01/typeNodes/StringTypeNode.test.ts @@ -1,8 +1,8 @@ import { numberTypeNode, sizePrefixTypeNode, stringTypeNode } from '@kinobi-so/nodes'; -import test from 'ava'; +import { expect, test } from 'vitest'; import { typeNodeFromAnchorV01 } from '../../../src/index.js'; -test('it creates string type nodes', t => { - t.deepEqual(typeNodeFromAnchorV01('string'), sizePrefixTypeNode(stringTypeNode('utf8'), numberTypeNode('u32'))); +test('it creates string type nodes', () => { + expect(typeNodeFromAnchorV01('string')).toEqual(sizePrefixTypeNode(stringTypeNode('utf8'), numberTypeNode('u32'))); }); diff --git a/packages/nodes-from-anchor/test/v01/typeNodes/StructTypeNode.test.ts b/packages/nodes-from-anchor/test/v01/typeNodes/StructTypeNode.test.ts index 466cb3a1..b1693f48 100644 --- a/packages/nodes-from-anchor/test/v01/typeNodes/StructTypeNode.test.ts +++ b/packages/nodes-from-anchor/test/v01/typeNodes/StructTypeNode.test.ts @@ -5,11 +5,11 @@ import { structFieldTypeNode, structTypeNode, } from '@kinobi-so/nodes'; -import test from 'ava'; +import { expect, test } from 'vitest'; import { typeNodeFromAnchorV01 } from '../../../src/index.js'; -test('it creates struct type nodes', t => { +test('it creates struct type nodes', () => { // TODO: Fix 2 fields always registering as a tuple when this should be a struct const node = typeNodeFromAnchorV01({ fields: [ @@ -20,8 +20,7 @@ test('it creates struct type nodes', t => { kind: 'struct', }); - t.deepEqual( - node, + expect(node).toEqual( structTypeNode([ structFieldTypeNode({ name: 'name', diff --git a/packages/nodes-from-anchor/test/v01/typeNodes/TupleTypeNode.test.ts b/packages/nodes-from-anchor/test/v01/typeNodes/TupleTypeNode.test.ts index 45a41ab7..3975123d 100644 --- a/packages/nodes-from-anchor/test/v01/typeNodes/TupleTypeNode.test.ts +++ b/packages/nodes-from-anchor/test/v01/typeNodes/TupleTypeNode.test.ts @@ -1,13 +1,13 @@ import { numberTypeNode, publicKeyTypeNode, tupleTypeNode } from '@kinobi-so/nodes'; -import test from 'ava'; +import { expect, test } from 'vitest'; import { typeNodeFromAnchorV01 } from '../../../src/index.js'; -test('it creates tuple type nodes', t => { +test('it creates tuple type nodes', () => { const node = typeNodeFromAnchorV01({ fields: ['u8', 'pubkey'], kind: 'struct', }); - t.deepEqual(node, tupleTypeNode([numberTypeNode('u8'), publicKeyTypeNode()])); + expect(node).toEqual(tupleTypeNode([numberTypeNode('u8'), publicKeyTypeNode()])); });