Skip to content

Commit

Permalink
test: update tests for progress tracker and HTTP schema.org namespace
Browse files Browse the repository at this point in the history
- Modify options.test.ts to include useEvents flag in expected output
- Update context.test.ts to use HTTP instead of HTTPS for schema.org namespace
- Adjust assertions in context.test.ts to reflect new JSON-LD expansion behavior
- Ensure test cases cover new progress tracker functionality
  • Loading branch information
Brian Leonard authored and Brian Leonard committed Sep 10, 2024
1 parent 3ebab0a commit 9b5f624
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/schema/context.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Deno.test({
const context = new psychDSContext(fileTree, file, issues,dsContext)

await context.loadSidecar(fileTree)
if("https://schema.org/key" in context.expandedSidecar){
assertEquals(context.expandedSidecar['https://schema.org/key'],[{"@value":"value"}])}
if("http://schema.org/key" in context.expandedSidecar){
assertEquals(context.expandedSidecar['http://schema.org/key'],[{"@value":"value"}])}
else
assertEquals(1,2)
})
Expand All @@ -48,8 +48,8 @@ Deno.test({
const context = new psychDSContext(fileTree, file, issues,dsContext)

await context.loadSidecar(fileTree)
if("https://schema.org/key" in context.expandedSidecar)
assertEquals(context.expandedSidecar['https://schema.org/key'],[{"@value":"value2"}])
if("http://schema.org/key" in context.expandedSidecar)
assertEquals(context.expandedSidecar['http://schema.org/key'],[{"@value":"value2"}])
else
assertEquals(1,2)
})
Expand All @@ -61,7 +61,7 @@ Deno.test({
const context = new psychDSContext(fileTree, file, issues,dsContext)

await context.loadSidecar(fileTree)
assertEquals("https://schema.org/name" in context.expandedSidecar,true)
assertEquals("http://schema.org/name" in context.expandedSidecar,true)
})

await t.step('no context in sidecar', async() => {
Expand All @@ -83,6 +83,6 @@ Deno.test({
delete context.expandedSidecar['@context']

await context.loadSidecar(noCtxFileTree)
assertEquals("https://schema.org/name" in context.expandedSidecar,false)
assertEquals("http://schema.org/name" in context.expandedSidecar,false)
})
}})
2 changes: 2 additions & 0 deletions src/setup/options.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Deno.test('options parsing', async (t) => {
schema: 'latest',
debug: 'error',
verbose: undefined,
useEvents: undefined,
showWarnings: undefined
})
})
Expand All @@ -29,6 +30,7 @@ Deno.test('options parsing', async (t) => {
schema: '1.0.0',
debug: 'info',
verbose: true,
useEvents: undefined,
showWarnings: true
})
})
Expand Down

0 comments on commit 9b5f624

Please sign in to comment.