coh-content-db 2.0.0-rc.1 → 2.0.0-rc.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +10 -11
- package/.github/workflows/build.yml +4 -2
- package/.github/workflows/pull-request.yml +1 -1
- package/.github/workflows/release.yml +2 -2
- package/CHANGELOG.md +43 -0
- package/README.md +52 -24
- package/dist/coh-content-db.d.ts +678 -279
- package/dist/coh-content-db.js +828 -371
- package/dist/coh-content-db.js.map +1 -1
- package/dist/coh-content-db.mjs +803 -362
- package/dist/coh-content-db.mjs.map +1 -1
- package/eslint.config.mjs +1 -0
- package/package.json +1 -1
- package/src/main/api/alignment.ts +18 -2
- package/src/main/api/alternate-data.ts +2 -2
- package/src/main/api/badge-data.ts +20 -48
- package/src/main/api/badge-requirement-data.ts +64 -0
- package/src/main/api/badge-requirement-type.ts +32 -0
- package/src/main/api/badge-type.ts +15 -15
- package/src/main/api/bundle-data.ts +47 -0
- package/src/main/api/bundle-header-data.ts +37 -0
- package/src/main/api/contact-data.ts +48 -0
- package/src/main/api/enhancement-category.ts +26 -26
- package/src/main/api/location-data.ts +28 -0
- package/src/main/api/markdown-string.ts +4 -0
- package/src/main/api/mission-data.ts +83 -0
- package/src/main/api/mission-type.ts +2 -0
- package/src/main/api/morality.ts +31 -0
- package/src/main/api/sex.ts +8 -1
- package/src/main/api/zone-data.ts +20 -0
- package/src/main/db/abstract-index.ts +37 -0
- package/src/main/db/alignment-list.ts +54 -0
- package/src/main/db/alternates.ts +28 -42
- package/src/main/db/badge-index.ts +60 -0
- package/src/main/db/badge-requirement.ts +81 -0
- package/src/main/db/badge-search-options.ts +47 -0
- package/src/main/db/badge.ts +76 -71
- package/src/main/db/bundle-header.ts +44 -0
- package/src/main/db/coh-content-database.ts +123 -14
- package/src/main/db/contact.ts +62 -0
- package/src/main/db/location.ts +30 -0
- package/src/main/db/mission.ts +107 -0
- package/src/main/db/morality-list.ts +99 -0
- package/src/main/db/paged.ts +7 -0
- package/src/main/db/zone.ts +28 -0
- package/src/main/index.ts +23 -15
- package/src/main/util.ts +108 -7
- package/src/test/api/alignment.test.ts +38 -4
- package/src/test/api/badge-data.fixture.ts +1 -15
- package/src/test/api/badge-data.test.ts +4 -4
- package/src/test/api/badge-requirement-data.fixture.ts +7 -0
- package/src/test/api/badge-requirement-type.test.ts +31 -0
- package/src/test/api/badge-type.test.ts +5 -5
- package/src/test/api/bundle-data.fixture.ts +6 -0
- package/src/test/api/bundle-header-data.fixture.ts +6 -0
- package/src/test/api/contact-data.fixture.ts +7 -0
- package/src/test/api/enhancement-category.test.ts +5 -5
- package/src/test/api/mission-data.fixture.ts +12 -0
- package/src/test/api/sex.test.ts +33 -1
- package/src/test/api/zone-data.fixture.ts +8 -0
- package/src/test/db/abstract-index.test.ts +55 -0
- package/src/test/db/alignment-list.test.ts +200 -0
- package/src/test/db/alternates.test.ts +82 -117
- package/src/test/db/badge-index.test.ts +547 -0
- package/src/test/db/badge-requirement.test.ts +145 -0
- package/src/test/db/badge.test.ts +322 -14
- package/src/test/db/bundle-header.test.ts +76 -0
- package/src/test/db/coh-content-database.test.ts +264 -24
- package/src/test/db/contact.test.ts +97 -0
- package/src/test/db/location.test.ts +51 -0
- package/src/test/db/mission.test.ts +171 -0
- package/src/test/db/morality-list.test.ts +457 -0
- package/src/test/db/zone.test.ts +36 -0
- package/src/test/integration.test.ts +16 -0
- package/src/test/util.test.ts +144 -18
- package/src/main/api/badge-partial-data.ts +0 -65
- package/src/main/api/badge-partial-type.ts +0 -8
- package/src/main/api/change.ts +0 -14
- package/src/main/api/game-map-data.ts +0 -26
- package/src/main/api/plaque-type.ts +0 -6
- package/src/main/api/server-group-data.ts +0 -65
- package/src/main/api/vidiot-map-data.ts +0 -18
- package/src/main/api/vidiot-map-point-of-interest-data.ts +0 -30
- package/src/main/changelog.ts +0 -20
- package/src/main/db/badge-partial.ts +0 -35
- package/src/main/db/game-map.ts +0 -33
- package/src/main/db/server-group.ts +0 -112
- package/src/main/db/vidiot-map-point-of-interest.ts +0 -40
- package/src/main/db/vidiot-map.ts +0 -25
- package/src/test/api/badge-partial-data.fixture.ts +0 -17
- package/src/test/api/badge-partial-type.test.ts +0 -31
- package/src/test/api/game-map-data.fixture.ts +0 -10
- package/src/test/api/plaque-type.test.ts +0 -31
- package/src/test/api/server-group-data.fixture.ts +0 -23
- package/src/test/api/server-group-data.test.ts +0 -15
- package/src/test/api/vidiot-map-point-of-interest.fixture.ts +0 -10
- package/src/test/api/vidiot-map.fixture.ts +0 -9
- package/src/test/changelog.test.ts +0 -36
- package/src/test/db/server-group.test.ts +0 -124
- package/src/test/index.test.ts +0 -10
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { VidiotMapData } from '../api/vidiot-map-data'
|
|
2
|
-
import { VidiotMapPointOfInterest } from './vidiot-map-point-of-interest'
|
|
3
|
-
|
|
4
|
-
export class VidiotMap {
|
|
5
|
-
/**
|
|
6
|
-
* URL of the map image.
|
|
7
|
-
*/
|
|
8
|
-
readonly imageUrl: string
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Name to display for the Vidiot map.
|
|
12
|
-
*/
|
|
13
|
-
readonly name?: string
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* List of Points of Interest labelled on the image.
|
|
17
|
-
*/
|
|
18
|
-
readonly pointsOfInterest?: VidiotMapPointOfInterest[]
|
|
19
|
-
|
|
20
|
-
constructor(data: VidiotMapData) {
|
|
21
|
-
this.imageUrl = data.imageUrl
|
|
22
|
-
this.name = data.name
|
|
23
|
-
this.pointsOfInterest = data.pointsOfInterest?.map(data => new VidiotMapPointOfInterest(data))
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { defineFixture } from 'efate'
|
|
2
|
-
import { BADGE_PARTIAL_TYPE, BadgePartialData, ENHANCEMENT_CATEGORY, PLAQUE_TYPE } from '../../main'
|
|
3
|
-
|
|
4
|
-
export const badgePartialDataFixture = defineFixture<BadgePartialData>((t) => {
|
|
5
|
-
t.key.as(index => `badge-partial-${index}`)
|
|
6
|
-
t.type.pickFrom([...BADGE_PARTIAL_TYPE])
|
|
7
|
-
t.mapKey?.asString()
|
|
8
|
-
t.loc?.asArray()
|
|
9
|
-
t.plaqueType?.pickFrom([...PLAQUE_TYPE])
|
|
10
|
-
t.inscription?.asLoremIpsum()
|
|
11
|
-
t.vidiotMapKey?.asString()
|
|
12
|
-
t.badgeKey?.as(index => `badge-${index}`)
|
|
13
|
-
t.inventionLevel?.asNumber()
|
|
14
|
-
t.inventionTypes?.pickFrom([...ENHANCEMENT_CATEGORY])
|
|
15
|
-
t.inventionCount?.asNumber()
|
|
16
|
-
t.notes?.asLoremIpsum()
|
|
17
|
-
})
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { BADGE_PARTIAL_TYPE, BadgePartialType } from '../../main'
|
|
2
|
-
|
|
3
|
-
describe('BADGE_PARTIAL_TYPE', () => {
|
|
4
|
-
test('should be an array', () => {
|
|
5
|
-
expect(Array.isArray(BADGE_PARTIAL_TYPE)).toBeTruthy()
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
test('should not be empty', () => {
|
|
9
|
-
expect(BADGE_PARTIAL_TYPE).not.toHaveLength(0)
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
test('should contain only strings', () => {
|
|
13
|
-
for (const entry of BADGE_PARTIAL_TYPE) {
|
|
14
|
-
expect(typeof entry).toBe('string')
|
|
15
|
-
}
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
test('should contain all known badge partial types', () => {
|
|
19
|
-
const expected = ['PLAQUE', 'BADGE', 'INVENTION', 'INVENTION_PLUS_ONE']
|
|
20
|
-
for (const category of expected) {
|
|
21
|
-
expect(BADGE_PARTIAL_TYPE).toContain(category)
|
|
22
|
-
}
|
|
23
|
-
})
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
describe('BadgePartialType', () => {
|
|
27
|
-
test('should be a usable type', () => {
|
|
28
|
-
const field: BadgePartialType = 'PLAQUE'
|
|
29
|
-
expect(field).toBe('PLAQUE')
|
|
30
|
-
})
|
|
31
|
-
})
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { GameMapData } from '../../main'
|
|
2
|
-
import { defineFixture } from 'efate'
|
|
3
|
-
import { vidiotMapFixture } from './vidiot-map.fixture'
|
|
4
|
-
|
|
5
|
-
export const gameMapDataFixture = defineFixture<GameMapData>((t) => {
|
|
6
|
-
t.key.as(index => `map-${index}`)
|
|
7
|
-
t.name.as(index => `Map ${index}`)
|
|
8
|
-
t.links?.asArray([{ href: 'https://nouri.org' }])
|
|
9
|
-
t.vidiotMaps?.arrayOfFixture({ fixture: vidiotMapFixture })
|
|
10
|
-
})
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { PLAQUE_TYPE, PlaqueType } from '../../main'
|
|
2
|
-
|
|
3
|
-
describe('PLAQUE_TYPE', () => {
|
|
4
|
-
test('should be an array', () => {
|
|
5
|
-
expect(Array.isArray(PLAQUE_TYPE)).toBeTruthy()
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
test('should not be empty', () => {
|
|
9
|
-
expect(PLAQUE_TYPE).not.toHaveLength(0)
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
test('should contain only strings', () => {
|
|
13
|
-
for (const entry of PLAQUE_TYPE) {
|
|
14
|
-
expect(typeof entry).toBe('string')
|
|
15
|
-
}
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
test('should contain all known plaque types', () => {
|
|
19
|
-
const expected = ['WALL_PLAQUE', 'MONUMENT']
|
|
20
|
-
for (const category of expected) {
|
|
21
|
-
expect(PLAQUE_TYPE).toContain(category)
|
|
22
|
-
}
|
|
23
|
-
})
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
describe('PlaqueType', () => {
|
|
27
|
-
test('should be a usable type', () => {
|
|
28
|
-
const field: PlaqueType = 'WALL_PLAQUE'
|
|
29
|
-
expect(field).toBe('WALL_PLAQUE')
|
|
30
|
-
})
|
|
31
|
-
})
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { defineFixture } from 'efate'
|
|
2
|
-
import { Change, ServerGroupData } from '../../main'
|
|
3
|
-
import { archetypeDataFixture } from './archetype-data.fixture'
|
|
4
|
-
import { gameMapDataFixture } from './game-map-data.fixture'
|
|
5
|
-
import { badgeDataFixture } from './badge-data.fixture'
|
|
6
|
-
|
|
7
|
-
export const serverGroupDataFixture = defineFixture<ServerGroupData>((t) => {
|
|
8
|
-
t.key.as(index => `server-group-${index}`)
|
|
9
|
-
t.name.as(index => `Server Group ${index}`)
|
|
10
|
-
t.description?.asLoremIpsum()
|
|
11
|
-
t.repository?.as(index => `https://nouri.org?id=${index}`)
|
|
12
|
-
t.servers?.asArray()
|
|
13
|
-
t.archetypes?.arrayOfFixture({ fixture: archetypeDataFixture })
|
|
14
|
-
t.maps?.arrayOfFixture({ fixture: gameMapDataFixture })
|
|
15
|
-
t.badges?.arrayOfFixture({ fixture: badgeDataFixture })
|
|
16
|
-
t.changelog?.arrayOfFixture({
|
|
17
|
-
fixture: defineFixture<Change>((t) => {
|
|
18
|
-
t.version.as(index => `${index}`)
|
|
19
|
-
t.date.as(() => new Date())
|
|
20
|
-
t.description?.asLoremIpsum()
|
|
21
|
-
}),
|
|
22
|
-
})
|
|
23
|
-
})
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ServerGroupData } from '../../main'
|
|
2
|
-
import { TEST_BADGE } from './badge-data.test'
|
|
3
|
-
|
|
4
|
-
// If you change this test, update the example in the README as well
|
|
5
|
-
export const TEST_SERVER_GROUP: ServerGroupData = {
|
|
6
|
-
key: 'my-server-group',
|
|
7
|
-
name: 'My Server Group',
|
|
8
|
-
badges: [TEST_BADGE],
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
describe('ServerGroupData', () => {
|
|
12
|
-
test('should be a usable interface', () => {
|
|
13
|
-
expect(TEST_SERVER_GROUP).not.toBeNull()
|
|
14
|
-
})
|
|
15
|
-
})
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { defineFixture } from 'efate'
|
|
2
|
-
import { VidiotMapPointOfInterest } from '../../main'
|
|
3
|
-
|
|
4
|
-
export const vidiotMapPointOfInterestFixture = defineFixture<VidiotMapPointOfInterest>((t) => {
|
|
5
|
-
t.pos?.as(index => [index, index])
|
|
6
|
-
t.notes?.asLoremIpsum()
|
|
7
|
-
t.mapKey?.as(index => `map-${index}`)
|
|
8
|
-
t.badgeKey?.as(index => `badge-${index}`)
|
|
9
|
-
t.badgePartialKey?.as(index => `partial-${index}`)
|
|
10
|
-
})
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { defineFixture } from 'efate'
|
|
2
|
-
import { VidiotMap } from '../../main'
|
|
3
|
-
import { vidiotMapPointOfInterestFixture } from './vidiot-map-point-of-interest.fixture'
|
|
4
|
-
|
|
5
|
-
export const vidiotMapFixture = defineFixture<VidiotMap>((t) => {
|
|
6
|
-
t.imageUrl.as(index => `https://nouri.org?id=${index}`)
|
|
7
|
-
t.name?.as(index => `Vidiot Map ${index}`)
|
|
8
|
-
t.pointsOfInterest?.arrayOfFixture({ fixture: vidiotMapPointOfInterestFixture })
|
|
9
|
-
})
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { CHANGELOG } from '../main'
|
|
2
|
-
|
|
3
|
-
describe('CHANGELOG', () => {
|
|
4
|
-
test('should be extant', () => {
|
|
5
|
-
expect(CHANGELOG).not.toBeNull()
|
|
6
|
-
expect(CHANGELOG).not.toBeUndefined()
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
test('should be an array', () => {
|
|
10
|
-
expect(Array.isArray(CHANGELOG)).toBeTruthy()
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
test('should have only semver versions', () => {
|
|
14
|
-
// semver.org - https://regex101.com/r/vkijKf/1/
|
|
15
|
-
const pattern = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/
|
|
16
|
-
|
|
17
|
-
for (const change of CHANGELOG) {
|
|
18
|
-
expect(pattern.test(change.version)).toBeTruthy()
|
|
19
|
-
}
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
test('should have dates', () => {
|
|
23
|
-
for (const change of CHANGELOG) {
|
|
24
|
-
const date = change.date
|
|
25
|
-
expect(date).not.toBeNull()
|
|
26
|
-
expect(date).not.toBeUndefined()
|
|
27
|
-
}
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
test('should have descriptions', () => {
|
|
31
|
-
for (const change of CHANGELOG) {
|
|
32
|
-
expect(change).not.toBeNull()
|
|
33
|
-
expect(change).not.toBeUndefined()
|
|
34
|
-
}
|
|
35
|
-
})
|
|
36
|
-
})
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { ServerGroup } from '../../main'
|
|
2
|
-
import { serverGroupDataFixture } from '../api/server-group-data.fixture'
|
|
3
|
-
import { badgeDataFixture } from '../api/badge-data.fixture'
|
|
4
|
-
import { gameMapDataFixture } from '../api/game-map-data.fixture'
|
|
5
|
-
import { archetypeDataFixture } from '../api/archetype-data.fixture'
|
|
6
|
-
|
|
7
|
-
describe(ServerGroup.name, () => {
|
|
8
|
-
describe('Constructor', () => {
|
|
9
|
-
test(`should accept the test fixture`, () => {
|
|
10
|
-
new ServerGroup(serverGroupDataFixture.create())
|
|
11
|
-
})
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
describe('archetypes', () => {
|
|
15
|
-
test(`should throw an error on duplicate key`, () => {
|
|
16
|
-
const data = serverGroupDataFixture.create({
|
|
17
|
-
archetypes: [
|
|
18
|
-
archetypeDataFixture.create({ key: 'foo' }),
|
|
19
|
-
archetypeDataFixture.create({ key: 'foo' }),
|
|
20
|
-
],
|
|
21
|
-
})
|
|
22
|
-
expect(() => new ServerGroup(data)).toThrow('Duplicate archetype key [foo]')
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
test(`should accept an empty list`, () => {
|
|
26
|
-
const data = serverGroupDataFixture
|
|
27
|
-
.omit('archetypes')
|
|
28
|
-
.create()
|
|
29
|
-
expect(() => new ServerGroup(data).archetypes).toHaveLength(0)
|
|
30
|
-
})
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
describe('badges', () => {
|
|
34
|
-
test(`should throw an error on duplicate key`, () => {
|
|
35
|
-
const data = serverGroupDataFixture.create({
|
|
36
|
-
badges: [
|
|
37
|
-
badgeDataFixture.create({ key: 'foo' }),
|
|
38
|
-
badgeDataFixture.create({ key: 'foo' }),
|
|
39
|
-
],
|
|
40
|
-
})
|
|
41
|
-
expect(() => new ServerGroup(data)).toThrow('Duplicate badge key [foo]')
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
test(`should accept an empty list`, () => {
|
|
45
|
-
const data = serverGroupDataFixture
|
|
46
|
-
.omit('badges')
|
|
47
|
-
.create()
|
|
48
|
-
expect(() => new ServerGroup(data).badges).toHaveLength(0)
|
|
49
|
-
})
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
describe('maps', () => {
|
|
53
|
-
test(`should throw an error on duplicate map`, () => {
|
|
54
|
-
const data = serverGroupDataFixture.create({
|
|
55
|
-
maps: [
|
|
56
|
-
gameMapDataFixture.create({ key: 'foo' }),
|
|
57
|
-
gameMapDataFixture.create({ key: 'foo' }),
|
|
58
|
-
],
|
|
59
|
-
})
|
|
60
|
-
expect(() => new ServerGroup(data)).toThrow('Duplicate map key [foo]')
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
test(`should accept an empty list`, () => {
|
|
64
|
-
const data = serverGroupDataFixture
|
|
65
|
-
.omit('maps')
|
|
66
|
-
.create()
|
|
67
|
-
expect(() => new ServerGroup(data).maps).toHaveLength(0)
|
|
68
|
-
})
|
|
69
|
-
})
|
|
70
|
-
|
|
71
|
-
describe('getArchetype', () => {
|
|
72
|
-
test(`should retrieve archetype from the index`, () => {
|
|
73
|
-
const data = serverGroupDataFixture.create({
|
|
74
|
-
archetypes: [archetypeDataFixture.create({ key: 'foo' })],
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
expect(new ServerGroup(data).getArchetype('foo')).not.toBeNull()
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
test(`should throw error for unknown archetype`, () => {
|
|
81
|
-
const data = serverGroupDataFixture.create({
|
|
82
|
-
archetypes: [],
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
expect(() => new ServerGroup(data).getArchetype('foo')).toThrow('Unknown archetype key [foo]')
|
|
86
|
-
})
|
|
87
|
-
})
|
|
88
|
-
|
|
89
|
-
describe('getMap', () => {
|
|
90
|
-
test(`should retrieve map from the index`, () => {
|
|
91
|
-
const data = serverGroupDataFixture.create({
|
|
92
|
-
maps: [gameMapDataFixture.create({ key: 'foo' })],
|
|
93
|
-
})
|
|
94
|
-
|
|
95
|
-
expect(new ServerGroup(data).getMap('foo')).not.toBeNull()
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
test(`should throw error for unknown map`, () => {
|
|
99
|
-
const data = serverGroupDataFixture.create({
|
|
100
|
-
maps: [],
|
|
101
|
-
})
|
|
102
|
-
|
|
103
|
-
expect(() => new ServerGroup(data).getMap('foo')).toThrow('Unknown map key [foo]')
|
|
104
|
-
})
|
|
105
|
-
})
|
|
106
|
-
|
|
107
|
-
describe('getBadge', () => {
|
|
108
|
-
test(`should retrieve badge from the index`, () => {
|
|
109
|
-
const data = serverGroupDataFixture.create({
|
|
110
|
-
badges: [badgeDataFixture.create({ key: 'foo' })],
|
|
111
|
-
})
|
|
112
|
-
|
|
113
|
-
expect(new ServerGroup(data).getBadge('foo')).not.toBeNull()
|
|
114
|
-
})
|
|
115
|
-
|
|
116
|
-
test(`should throw error for unknown badge`, () => {
|
|
117
|
-
const data = serverGroupDataFixture.create({
|
|
118
|
-
badges: [],
|
|
119
|
-
})
|
|
120
|
-
|
|
121
|
-
expect(() => new ServerGroup(data).getBadge('foo')).toThrow('Unknown badge key [foo]')
|
|
122
|
-
})
|
|
123
|
-
})
|
|
124
|
-
})
|
package/src/test/index.test.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as index from '../main/index'
|
|
2
|
-
|
|
3
|
-
test('should export the changelog', () => {
|
|
4
|
-
expect(index).toHaveProperty('CHANGELOG')
|
|
5
|
-
})
|
|
6
|
-
|
|
7
|
-
test('should export badge reference utils', () => {
|
|
8
|
-
expect(index).toHaveProperty('createBadgeReference')
|
|
9
|
-
expect(index).toHaveProperty('createMapReference')
|
|
10
|
-
})
|