Skip to content

TypeScript migration #55

TypeScript migration

TypeScript migration #55

GitHub Actions / Mocha test results succeeded Sep 12, 2023 in 0s

Mocha test results βœ…

Tests passed successfully

βœ…Β test-results.json

160 tests were completed in 18s with 160 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
test/func/alias.js 8βœ… 162ms
test/func/area.js 3βœ… 3ms
test/func/author-credit.js 4βœ… 54ms
test/func/entity.js 5βœ… 31ms
test/func/externalServiceOauth.js 4βœ… 7ms
test/func/identifier.js 4βœ… 47ms
test/func/language.js 3βœ… 25ms
test/func/relationship.js 4βœ… 156ms
test/func/relationshipAttributes.js 4βœ… 59ms
test/func/set.js 16βœ… 40ms
test/func/work.js 2βœ… 3ms
test/testAchievementType.js 1βœ… 6ms
test/testAchievementUnlock.js 1βœ… 2ms
test/testAlias.js 1βœ… 3ms
test/testAliasSet.js 4βœ… 27ms
test/testAnnotation.js 1βœ… 5ms
test/testArea.js 3βœ… 14ms
test/testAuthor.js 7βœ… 87ms
test/testAuthorRevision.js 1βœ… 4ms
test/testDisambiguation.js 1βœ… 3ms
test/testEdition.js 7βœ… 131ms
test/testEditionGroup.js 4βœ… 48ms
test/testEditionGroupRevision.js 1βœ… 4ms
test/testEditionRevision.js 1βœ… 4ms
test/testEditor.js 1βœ… 9ms
test/testEditorEntityVisits.js 1βœ… 3ms
test/testEditorType.js 1βœ… 3ms
test/testEntity.js 1βœ… 3ms
test/testExternalServiceOauth.js 1βœ… 4ms
test/testGender.js 1βœ… 3ms
test/testIdentifier.js 1βœ… 10ms
test/testIdentifierSet.js 4βœ… 20ms
test/testIdentifierType.js 1βœ… 3ms
test/testLanguage.js 1βœ… 3ms
test/testLanguageSet.js 4βœ… 21ms
test/testModule.js 3βœ… 6ms
test/testPublisher.js 4βœ… 50ms
test/testPublisherRevision.js 1βœ… 4ms
test/testRelationship.js 2βœ… 21ms
test/testRelationshipAttributes.js 1βœ… 4ms
test/testRelationshipAttributeSet.js 4βœ… 20ms
test/testRelationshipAttributeType.js 1βœ… 3ms
test/testRelationshipSet.js 4βœ… 23ms
test/testRelationshipType.js 2βœ… 10ms
test/testRevision.js 1βœ… 7ms
test/testSeries.js 5βœ… 57ms
test/testSeriesOrderingType.js 1βœ… 3ms
test/testSeriesRevision.js 1βœ… 5ms
test/testTitleType.js 1βœ… 4ms
test/testTitleUnlock.js 1βœ… 2ms
test/testUserCollection.js 2βœ… 11ms
test/testWork.js 4βœ… 44ms
test/testWorkRevision.js 1βœ… 4ms
test/util.js 14βœ… 2ms

βœ…Β test/func/alias.js

updateAliasSet
  βœ… should allow only one primary alias per language
  βœ… should allow only the default alias to be primary for that language
  βœ… should error if a set of aliases is passed with no default
  βœ… should return a new set if changes are made to the aliases in the set
  βœ… should return a new set if the default alias is changed
  βœ… should return a set with one alias if one alias is added to an empty set
  βœ… should return null if all null/empty sets are passed
  βœ… should return the old set if no changes are made

βœ…Β test/func/area.js

recursivelyGetAreaParentsWithNames
  βœ… should return all levels when checkAllLevels is true
  βœ… should return an array of areas with their names, sorted by type
  βœ… should work when calling parents() on an Area model

βœ…Β test/func/author-credit.js

fetchOrCreateCredit
  βœ… should create a single author credit if called twice
updateCreateCredit
  βœ… should return a new credit if the credit is updated
  βœ… should return the original credit if changed, and then reverted
  βœ… should return the original credit if the credit is unchanged

βœ…Β test/func/entity.js

getEntity
  βœ… should return an entity
  βœ… should return an entity with extra relations
  βœ… should return the target entity for a redirected bbid
recursivelyGetRedirectBBID
  βœ… should return a multiple-step redirected bbid
  βœ… should return a single-step redirected bbid

βœ…Β test/func/externalServiceOauth.js

deleteOauthToken
  βœ… should delete oauth token
getOauthToken
  βœ… should return oauth token
saveOauthToken
  βœ… should save oauth token and return the saved token
updateOauthToken
  βœ… should update oauth token

βœ…Β test/func/identifier.js

updateIdentifierSet
  βœ… should return a new set if changes are made to the identifiers in the set
  βœ… should return a set with one identifier if one identifier is added to an empty set
  βœ… should return null if all null/empty sets are passed
  βœ… should return the old set if no changes are made

βœ…Β test/func/language.js

updateLanguageSet
  βœ… should return a set with one language if one language is added to an empty set
  βœ… should return null if all null/empty sets are passed
  βœ… should return the old set if no changes are made

βœ…Β test/func/relationship.js

updateRelationshipSet
  βœ… should return a new set if changes are made to the relationships in the set
  βœ… should return an empty object if all null/empty sets are passed
  βœ… should return an object with two entries if one relationship is added to an empty set
  βœ… should return the old set if no changes are made

βœ…Β test/func/relationshipAttributes.js

updateRelationshipAttributeSet
  βœ… should return a new set if changes are made to the attributes in the set
  βœ… should return a set with one attribute if one attribute is added to an empty set
  βœ… should return null if all null/empty sets are passed
  βœ… should return the old set if no changes are made

βœ…Β test/func/set.js

createNewSetWithItems
  βœ… should error out if non-existent unchanged items are provided
  βœ… should return a new set with one item if an item is added
  βœ… should return a new set with two items if an item is added to an existing unchanged item
  βœ… should return null if no items are provided
getAddedItems
  βœ… should return a single element when one element is different
  βœ… should return a single element when one element is different and duplicated
  βœ… should return an empty list for two arrays of identical objects
getRemovedItems
  βœ… should return a single element when one element is different
  βœ… should return a single element when one element is different and duplicated
  βœ… should return an empty list for two arrays of identical objects
getUnchangedItems
  βœ… should return a single element when one duplicated element is the same
  βœ… should return a single element when one element is different
  βœ… should return all objects for two arrays of identical objects
removeItemsFromSet
  βœ… should return a single element when one element is different
  βœ… should return a single element when one element is different and duplicated
  βœ… should return an empty list for two arrays of identical objects

βœ…Β test/func/work.js

loadAuthorNames
  βœ… should return an array of objects with appropriate keys when the list of workBBIDs is not empty
  βœ… should return an empty array if the list of workBBIDs is empty

βœ…Β test/testAchievementType.js

AchievementType model
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testAchievementUnlock.js

AchievementUnlock model
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testAlias.js

Alias model
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testAliasSet.js

AliasSet model
  βœ… should have an empty list of aliases when none are attached
  βœ… should have have an alias when one is set
  βœ… should have have two aliases when two are set
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testAnnotation.js

Annotation model
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testArea.js

Area model
  βœ… should return a JSON object with correct keys when saved
AreaType model
  βœ… should be fetched as relationship when fetching Area
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testAuthor.js

Author model
  βœ… should return a JSON object with correct keys when saved
  βœ… should return a JSON object with empty collections array
  βœ… should return a JSON object with related collections if there exist any
  βœ… should return the master revision when multiple revisions exist
Author model with Author Credits
  βœ… should return the associated Author Credits for an Author
  βœ… should return the associated Edition Groups using creditedEditionGroups method
  βœ… should return the associated Editions using creditedEditions method

βœ…Β test/testAuthorRevision.js

AuthorRevision model
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testDisambiguation.js

Disambiguation model
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testEdition.js

Edition model
  βœ… should automatically create an Edition Group editionGroupBbid has been unset in existing Edition
  βœ… should automatically create an Edition Group if none has been passed
  βœ… should return a JSON object with correct keys when saved
  βœ… should return a JSON object with empty collections array
  βœ… should return a JSON object with related collections if there exist any
  βœ… should return the master revision when multiple revisions exist
  βœ… should set the same Author Credit on auto-created Edition Group

βœ…Β test/testEditionGroup.js

EditionGroup model
  βœ… should return a JSON object with correct keys when saved
  βœ… should return a JSON object with empty collections array
  βœ… should return a JSON object with related collections if there exist any
  βœ… should return the master revision when multiple revisions exist

βœ…Β test/testEditionGroupRevision.js

EditionGroupRevision model
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testEditionRevision.js

EditionRevision model
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testEditor.js

Editor model
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testEditorEntityVisits.js

EditorEntityVisits model
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testEditorType.js

EditorType model
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testEntity.js

Entity model
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testExternalServiceOauth.js

ExternalServiceOauth model
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testGender.js

Gender model
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testIdentifier.js

Identifier model
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testIdentifierSet.js

IdentifierSet model
  βœ… should have an empty list of identifiers when none are attached
  βœ… should have have an identifier when one is set
  βœ… should have have two identifiers when two are set
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testIdentifierType.js

IdentifierType model
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testLanguage.js

Language model
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testLanguageSet.js

LanguageSet model
  βœ… should have an empty list of languages when none are attached
  βœ… should have have a language when one is set
  βœ… should have have two languages when two are set
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testModule.js

Module
  βœ… should have a bookshelf property with a knex property
  βœ… should have bookshelf and utils properties
  βœ… should return one model for each file in the models directory

βœ…Β test/testPublisher.js

Publisher model
  βœ… should return a JSON object with correct keys when saved
  βœ… should return a JSON object with empty collections array
  βœ… should return a JSON object with related collections if there exist any
  βœ… should return the master revision when multiple revisions exist

βœ…Β test/testPublisherRevision.js

PublisherRevision model
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testRelationship.js

Relationship model
  βœ… should return a JSON object with correct keys when saved
  βœ… should return a relationship with it's attributes when one is set

βœ…Β test/testRelationshipAttributes.js

Relationship Attribute model
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testRelationshipAttributeSet.js

RelationshipAttributeSet model
  βœ… should have an empty list of attributes when none are attached
  βœ… should have have a relationship attribute when one is set
  βœ… should have have two relationship attributes when two are set
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testRelationshipAttributeType.js

RelationshipAttributeType model
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testRelationshipSet.js

RelationshipSet model
  βœ… should have an empty list of relationships when none are attached
  βœ… should have have a relationship when one is set
  βœ… should have have two relationships when two are set
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testRelationshipType.js

RelationshipType model
  βœ… should return a JSON object with correct keys when saved
  βœ… should return attribute type associated with the relationship type

βœ…Β test/testRevision.js

Revision model
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testSeries.js

Series model
  βœ… should allow to update the series ordering type
  βœ… should return a JSON object with correct keys when saved
  βœ… should return a JSON object with empty collections array
  βœ… should return a JSON object with related collections
  βœ… should return the master revision when multiple revisions exist

βœ…Β test/testSeriesOrderingType.js

SeriesOrderingType model
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testSeriesRevision.js

SeriesRevision model
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testTitleType.js

TitleType model
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testTitleUnlock.js

TitleUnlock model
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/testUserCollection.js

UserCollection model
  βœ… should return a JSON object with itemCount when saved and fetched with withItemCount flag
  βœ… should return a JSON object without itemCount when saved and fetched without withItemCount flag

βœ…Β test/testWork.js

Work model
  βœ… should return a JSON object with correct keys when saved
  βœ… should return a JSON object with empty collections array
  βœ… should return a JSON object with related collections
  βœ… should return the master revision when multiple revisions exist

βœ…Β test/testWorkRevision.js

WorkRevision model
  βœ… should return a JSON object with correct keys when saved

βœ…Β test/util.js

Utils formatDate
  βœ… should allow negative years for full date and with missing month and/or day
  βœ… should return null when passed an invalid date object
  βœ… should return the date as ISO 8601 for a date object with missing month
  βœ… should return the date as ISO 8601 for a date object with missing month and day
  βœ… should return the date as ISO 8601 for a date object with year equal to zero
  βœ… should return the date as ISO 8601 for a full date object
Utils parseDate
  βœ… should allow BCE dates as extended ISO 8601-2004 date string
  βœ… should allow partial BCE dates as extended ISO 8601-2004 with missing day
  βœ… should allow partial BCE dates as extended ISO 8601-2004 with missing day and month
  βœ… should allow partial dates with missing day
  βœ… should allow partial dates with missing day and month
  βœ… should return an array of 3 null values when passed an invalid string (other than ISO 8601)
  βœ… should return the date as an array of 3 values when passed a full ISO 8601 date string
  βœ… should return the date as an array of 3 values when passed an extended ISO 8601-2004 date string