This repository has been archived by the owner on Feb 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
42,897 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Yarn build | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node: [ '12', '10' ] | ||
|
||
name: Node ${{ matrix.node }} build | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Get yarn cache | ||
id: yarn-cache | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ${{ steps.yarn-cache.outputs.dir }} | ||
key: ${{ runner.os }}-${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Setup node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
- run: yarn install --frozen-lockfile --non-interactive | ||
- run: yarn run build | ||
- run: yarn run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
import iiifManifest from '../../fixtures/presentation-2/iiif-fixture-manifest.json'; | ||
import iiifManifest2 from '../../fixtures/presentation-2/biblissima-manifest.json'; | ||
import blManifest from '../../fixtures/presentation-2/bl-manifest.json'; | ||
import nlwManifest from '../../fixtures/presentation-2/nlw-manifest.json'; | ||
import bodleianManifest from '../../fixtures/presentation-2/bodleian-manifest.json'; | ||
import stanfordManifest from '../../fixtures/presentation-2/stanford-manifest.json'; | ||
import folgerManifest from '../../fixtures/presentation-2/folger-manifest.json'; | ||
import villanovaManifest from '../../fixtures/presentation-2/villanova-manifest.json'; | ||
import ngaManifest from '../../fixtures/presentation-2/nga-manifest.json'; | ||
import quatarManifest from '../../fixtures/presentation-2/quatar-manifest.json'; | ||
import { presentation2to3 } from '../../packages/presentation-2-parser/src/upgrader'; | ||
import { Validator } from '../../packages/validator/src/validator'; | ||
|
||
describe('Presentation 2 to 3', () => { | ||
const validator = new Validator(); | ||
|
||
test('Simple manifest', () => { | ||
const result = presentation2to3.traverseManifest(iiifManifest as any); | ||
const isValid = validator.validateManifest(result); | ||
|
||
expect(validator.validators.manifest.errors).toEqual(null); | ||
expect(isValid).toEqual(true); | ||
}); | ||
test('Biblissima manifest', () => { | ||
const result = presentation2to3.traverseManifest(iiifManifest2 as any); | ||
const isValid = validator.validateManifest(result); | ||
|
||
expect(validator.validators.manifest.errors).toEqual(null); | ||
expect(isValid).toEqual(true); | ||
}); | ||
|
||
test('British Library manifest', () => { | ||
const result = presentation2to3.traverseManifest(blManifest as any); | ||
const isValid = validator.validateManifest(result); | ||
|
||
expect(validator.validators.manifest.errors).toEqual(null); | ||
expect(isValid).toEqual(true); | ||
}); | ||
|
||
test('NLW manifest', () => { | ||
const result = presentation2to3.traverseManifest(nlwManifest as any); | ||
const isValid = validator.validateManifest(result); | ||
|
||
expect(validator.validators.manifest.errors).toEqual(null); | ||
expect(isValid).toEqual(true); | ||
}); | ||
|
||
test('Bodleian manifest', () => { | ||
const result = presentation2to3.traverseManifest(bodleianManifest as any); | ||
const isValid = validator.validateManifest(result); | ||
|
||
expect(validator.validators.manifest.errors).toEqual(null); | ||
expect(isValid).toEqual(true); | ||
}); | ||
|
||
test('Stanford manifest', () => { | ||
const result = presentation2to3.traverseManifest(stanfordManifest as any); | ||
const isValid = validator.validateManifest(result); | ||
|
||
expect(validator.validators.manifest.errors).toEqual(null); | ||
expect(isValid).toEqual(true); | ||
}); | ||
|
||
test('Folger manifest', () => { | ||
const result = presentation2to3.traverseManifest(folgerManifest as any); | ||
const isValid = validator.validateManifest(result); | ||
|
||
expect(validator.validators.manifest.errors).toEqual(null); | ||
expect(isValid).toEqual(true); | ||
}); | ||
|
||
test('Villanova manifest', () => { | ||
const result = presentation2to3.traverseManifest(villanovaManifest as any); | ||
const isValid = validator.validateManifest(result); | ||
|
||
expect(validator.validators.manifest.errors).toEqual(null); | ||
expect(isValid).toEqual(true); | ||
}); | ||
|
||
test('NGA manifest', () => { | ||
const result = presentation2to3.traverseManifest(ngaManifest as any); | ||
const isValid = validator.validateManifest(result); | ||
|
||
expect(validator.validators.manifest.errors).toEqual(null); | ||
expect(isValid).toEqual(true); | ||
}); | ||
test('Quatar manifest', () => { | ||
const result = presentation2to3.traverseManifest(quatarManifest as any); | ||
const isValid = validator.validateManifest(result); | ||
|
||
expect(validator.validators.manifest.errors).toEqual(null); | ||
expect(isValid).toEqual(true); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.