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 3aef1f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<img src="./metadata/feature_graphic.png">
<a href="https://github.com/NonlinearFruit/Creeds.json/tree/master/creeds"><img src="https://img.shields.io/badge/documents-41-blue"></a>
<a href="https://github.com/NonlinearFruit/Creeds.json/actions/workflows/DataValidation.yml"><img src="https://img.shields.io/github/actions/workflow/status/NonlinearFruit/Creeds.json/DataValidation.yml?label=tests&branch=master"></a>
<a href="https://github.com/NonlinearFruit/Creeds.json/tree/master/spec"><img src="https://img.shields.io/badge/test%20count-8918-yellowgreen"></a>
<a href="https://github.com/NonlinearFruit/Creeds.json/tree/master/spec"><img src="https://img.shields.io/badge/test%20count-13217-yellowgreen"></a>
</p>

This is a collection of historic creeds of the Christian faith. This repo focuses on the Reformed church.
Expand Down
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 3aef1f3

Please sign in to comment.