Skip to content

Commit

Permalink
Test references individually
Browse files Browse the repository at this point in the history
  • Loading branch information
NonlinearFruit committed Aug 19, 2023
1 parent 328cfb8 commit 5fb7248
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tests/all.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,10 @@ export const testDocument = (document: CreedDocument<any>, filename: string) =>
}

const testReferences = (proof: any) => {
test('each reference is valid', async () => {
expect(proof.References).toBeInstanceOf(Array)
for (const reference of proof.References) {
for(const reference of proof.References)
test(`${reference} is valid`, async () => {
expect(reference).not.toContain(';')
}
})
})
}

export const testProofs = (item: any) => {
Expand Down Expand Up @@ -101,7 +99,7 @@ export const testProofs = (item: any) => {
expect(proofTextIds).toContain(footnoteId)
})

describe.each(item.Proofs)('Proof: $id', (proof) => {
describe.each(item.Proofs)('Proof: $Id', (proof) => {
validateSchema("Proof", proof)

testReferences(proof)
Expand Down

0 comments on commit 5fb7248

Please sign in to comment.