Skip to content

Commit

Permalink
Use hedSchemas object directly in converter tests for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
happy5214 committed Jul 29, 2024
1 parent 22729a5 commit 96375db
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions converter/__tests__/converter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import { buildSchemas } from '../../validator/schema/init'

describe('HED string conversion', () => {
const hedSchemaFile = 'tests/data/HED8.0.0.xml'
let hedSchemaPromise
let hedSchemas

beforeAll(() => {
beforeAll(async () => {
const spec1 = new SchemaSpec('', '8.0.0', '', hedSchemaFile)
const specs = new SchemasSpec().addSchemaSpec(spec1)
hedSchemaPromise = buildSchemas(specs)
hedSchemas = await buildSchemas(specs)
})

describe('HED tags', () => {
Expand All @@ -28,7 +28,6 @@ describe('HED string conversion', () => {
* @returns {Promise<void>}
*/
const validatorBase = async function (testStrings, expectedResults, expectedIssues, testFunction) {
const hedSchemas = await hedSchemaPromise
for (const [testStringKey, testString] of Object.entries(testStrings)) {
const [testResult, issues] = testFunction(hedSchemas, testString)
assert.strictEqual(testResult, expectedResults[testStringKey], testString)
Expand Down Expand Up @@ -527,7 +526,6 @@ describe('HED string conversion', () => {
* @returns {Promise<void>}
*/
const validatorBase = async function (testStrings, expectedResults, expectedIssues, testFunction) {
const hedSchemas = await hedSchemaPromise
for (const [testStringKey, testString] of Object.entries(testStrings)) {
const [testResult, issues] = testFunction(hedSchemas, testString)
assert.strictEqual(testResult, expectedResults[testStringKey], testString)
Expand Down

0 comments on commit 96375db

Please sign in to comment.