Skip to content

Commit a55c9ea

Browse files
authored
Merge pull request #237 from zazuko/hydra-shapes-graph
2 parents 353d4f3 + 8e1a0cd commit a55c9ea

38 files changed

+488
-254
lines changed

.changeset/yummy-wombats-switch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@kopflos-cms/hydra": patch
3+
---
4+
5+
Improve shapes graph for hydra Collections

labs/handlebars/test/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { expect } from 'chai'
33
import { createEnv } from '@kopflos-cms/core/env.js' // eslint-disable-line import/no-unresolved
44
import process from '../index.js'
55

6-
describe('@kopflos-labs/handlebars', () => {
6+
describe('@kopflos-labs/handlebars', function () {
77
beforeEach(createStore(import.meta.url, {
88
format: 'ttl',
99
}))
@@ -23,7 +23,7 @@ describe('@kopflos-labs/handlebars', () => {
2323
expect(result).to.equal('http://example.org/article')
2424
})
2525

26-
describe('valueof helper', () => {
26+
describe('valueof helper', function () {
2727
it('follows the path and prints value', function () {
2828
const result = process('{{ valueof "schema:image/schema:thumbnail/schema:contentUrl" }}', {
2929
pointer: this.rdf.graph.namedNode('http://example.org/article'),

labs/html-template/test/index.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import type { AnyPointer } from 'clownface'
77
import snapshots from 'mocha-chai-rdf/snapshots.js'
88
import bindTemplate from '../index.js'
99

10-
describe('@kopflos-labs/html-template', () => {
10+
describe('@kopflos-labs/html-template', function () {
1111
use(snapshots)
1212

13-
it('uses core representation a default template data', async () => {
13+
it('uses core representation a default template data', async function () {
1414
// given
1515
const templateFunc = sinon.stub()
1616
const context = {
@@ -41,7 +41,7 @@ describe('@kopflos-labs/html-template', () => {
4141
expect(templateData.dataset).canonical.toMatchSnapshot()
4242
})
4343

44-
it('fetches data with given arguments', async () => {
44+
it('fetches data with given arguments', async function () {
4545
// given
4646
const templateFunc = sinon.stub()
4747
const fetchData = sinon.stub().returns(({ env }: HandlerArgs) => {
@@ -77,7 +77,7 @@ describe('@kopflos-labs/html-template', () => {
7777
expect(templateData.dataset).canonical.toMatchSnapshot()
7878
})
7979

80-
it('fetches data as stream', async () => {
80+
it('fetches data as stream', async function () {
8181
// given
8282
const templateFunc = sinon.stub()
8383
const fetchData = sinon.stub().returns(({ env }: HandlerArgs) => {
@@ -112,7 +112,7 @@ describe('@kopflos-labs/html-template', () => {
112112
expect(templateData.dataset).canonical.toMatchSnapshot()
113113
})
114114

115-
it('returns error if previous response is not a string', async () => {
115+
it('returns error if previous response is not a string', async function () {
116116
// given
117117
const context = {
118118
env: createEnv({
@@ -135,7 +135,7 @@ describe('@kopflos-labs/html-template', () => {
135135
expect(result).to.be.an('error')
136136
})
137137

138-
it('returns error if there is no previous response', async () => {
138+
it('returns error if there is no previous response', async function () {
139139
// given
140140
const context = {
141141
env: createEnv({

labs/html-template/test/lib/replaceTemplates.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { expect } from 'chai'
88
import { replaceTemplates } from '../../lib/replaceTemplates.js'
99
import type { TemplateFunc } from '../../index.js'
1010

11-
describe('@kopflos-labs/html-template/lib/replaceTemplates.js', () => {
11+
describe('@kopflos-labs/html-template/lib/replaceTemplates.js', function () {
1212
before(createStore(import.meta.url, {
1313
format: 'ttl',
1414
}))
@@ -20,7 +20,7 @@ describe('@kopflos-labs/html-template/lib/replaceTemplates.js', () => {
2020
},
2121
})
2222

23-
context('<template target-class>', () => {
23+
context('<template target-class>', function () {
2424
it('finds target by absolute url', function () {
2525
// given
2626
const graph = this.rdf.graph
@@ -43,7 +43,7 @@ http://example.org/Foo
4343
})
4444
})
4545

46-
context('<template property>', () => {
46+
context('<template property>', function () {
4747
it('descends into the graph', function () {
4848
// given
4949
const graph = this.rdf.graph

labs/html-template/test/lib/url.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ import { expect } from 'chai'
22
import rdf from '@zazuko/env-node'
33
import { toNamedNode } from '../../lib/url.js'
44

5-
describe('@kopflos-labs/html-template/lib/url.js', () => {
5+
describe('@kopflos-labs/html-template/lib/url.js', function () {
66
const ns = rdf.namespace('http://example.org/')
77

8-
it('expands relative urls against base', () => {
8+
it('expands relative urls against base', function () {
99
expect(toNamedNode(rdf, ns, 'Class')).eq(ns.Class)
1010
})
1111

12-
it('keeps absolute URL', () => {
12+
it('keeps absolute URL', function () {
1313
expect(toNamedNode(rdf, ns, 'http://foo.bar/Baz')).eq(rdf.namedNode('http://foo.bar/Baz'))
1414
})
1515

16-
it('expands known prefixed named', () => {
16+
it('expands known prefixed named', function () {
1717
expect(toNamedNode(rdf, ns, 'schema:Thing')).eq(rdf.ns.schema.Thing)
1818
})
1919
})

package-lock.json

Lines changed: 73 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"devDependencies": {
2020
"@changesets/cli": "^2.27.10",
21-
"@tpluscode/eslint-config": "^0.5",
21+
"@tpluscode/eslint-config": "^0.6",
2222
"@types/chai": "^5",
2323
"@types/debug": "^4.1.12",
2424
"@types/mocha": "^10.0.7",

packages/cli/test/lib/command/serve.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ describe('kopflos/lib/command/serve', function () {
1313
let process: ReturnType<typeof fork>
1414

1515
beforeEach(createEmpty)
16+
1617
beforeEach(function () {
1718
process = fork(serve)
1819
fs.mkdirSync(fixturesDir)

packages/cli/test/lib/config.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { loadConfig, prepareConfig } from '../../lib/config.js'
55
describe('kopflos/lib/config.js', function () {
66
this.timeout(10000)
77

8-
describe('loadConfig', () => {
9-
it('should discover the config file', async () => {
8+
describe('loadConfig', function () {
9+
it('should discover the config file', async function () {
1010
const { config } = await loadConfig({
1111
path: undefined,
1212
root: url.fileURLToPath(new URL('..', import.meta.url)),
@@ -17,7 +17,7 @@ describe('kopflos/lib/config.js', function () {
1717
})
1818
})
1919

20-
it('should load config from path', async () => {
20+
it('should load config from path', async function () {
2121
// given
2222
const configPath = url.fileURLToPath(new URL('../fixtures/config.json', import.meta.url))
2323

@@ -33,8 +33,8 @@ describe('kopflos/lib/config.js', function () {
3333
})
3434
})
3535

36-
describe('prepareConfig', () => {
37-
it('sets config itself as watched paths', async () => {
36+
describe('prepareConfig', function () {
37+
it('sets config itself as watched paths', async function () {
3838
// given
3939
const configPath = url.fileURLToPath(new URL('../fixtures/config.json', import.meta.url))
4040

@@ -50,7 +50,7 @@ describe('kopflos/lib/config.js', function () {
5050
expect(config.watch).to.deep.eq([configPath])
5151
})
5252

53-
it('adds config itself to watched paths', async () => {
53+
it('adds config itself to watched paths', async function () {
5454
// given
5555
const configPath = url.fileURLToPath(new URL('../fixtures/config.with-watch.json', import.meta.url))
5656

@@ -66,7 +66,7 @@ describe('kopflos/lib/config.js', function () {
6666
expect(config.watch).to.contain.all.members([configPath, 'lib'])
6767
})
6868

69-
it('rebase relative plugin paths to config path', async () => {
69+
it('rebase relative plugin paths to config path', async function () {
7070
// given
7171
const configPath = url.fileURLToPath(new URL('../fixtures/config.with-relative.json', import.meta.url))
7272

packages/core/test/handlers.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { ex } from '../../testing-helpers/ns.js'
99
import Kopflos from '../lib/Kopflos.js'
1010
import handlerLookupStub from './support/handlerLookupStub.js'
1111

12-
describe('@kopflos-cms/handlers.js', () => {
12+
describe('@kopflos-cms/handlers.js', function () {
1313
use(snapshots)
1414

1515
before(createStore(import.meta.url, { format: 'trig', includeDefaultGraph: true }))
@@ -20,7 +20,8 @@ describe('@kopflos-cms/handlers.js', () => {
2020
default: 'http://localhost:8080/sparql',
2121
},
2222
}
23-
describe('getCoreRepresentation', () => {
23+
24+
describe('getCoreRepresentation', function () {
2425
it('forwards core representation', async function () {
2526
// given
2627
const kopflos = new Kopflos(config, {

0 commit comments

Comments
 (0)