Skip to content

Commit

Permalink
Published aldeed:schema-index@4.0.0-beta.3
Browse files Browse the repository at this point in the history
  • Loading branch information
StorytellerCZ committed Apr 25, 2024
1 parent 167fc9b commit db64241
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions package/indexing/.versions
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
aldeed:collection2@4.0.0
aldeed:schema-index@4.0.0-beta.2
aldeed:collection2@4.0.1
aldeed:schema-index@4.0.0-beta.3
aldeed:simple-schema@1.13.1
allow-deny@1.1.1
babel-compiler@7.10.5
Expand Down
2 changes: 1 addition & 1 deletion tests/.meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ random@1.2.1
aldeed:schema-index
dynamic-import@0.7.3
meteortesting:mocha
aldeed:collection2@4.0.0
aldeed:collection2@4.0.1
32 changes: 16 additions & 16 deletions tests/indexing.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,24 +124,24 @@ describe('unique', () => {

const validationErrors = test.simpleSchema().namedContext().validationErrors();
expect(validationErrors.length).toBe(0);
});

// Insert same isbn again
await test.insertAsync({
title: 'Ulysses',
author: 'James Joyce',
copies: 1,
isbn,
}).then(id => {
expect(!!id).toBe(false);
}).catch(error => {
expect(error && error.message).toBe('ISBN must be unique');
const validationErrors = test.simpleSchema().namedContext().validationErrors();
expect(validationErrors.length).toBe(1);
// Insert same isbn again
await test.insertAsync({
title: 'Ulysses',
author: 'James Joyce',
copies: 1,
isbn,
}).catch(error => {
expect(error && error.message).toBe('ISBN must be unique');
const validationErrors = test.simpleSchema().namedContext().validationErrors();
expect(validationErrors.length).toBe(1);

const key = validationErrors[0] || {};
expect(key.name).toBe('isbn');
expect(key.type).toBe('notUnique');
});
const key = validationErrors[0] || {};
expect(key.name).toBe('isbn');
expect(key.type).toBe('notUnique');
}).then(id => {
expect(!!id).toBe(false);
});
});

Expand Down

0 comments on commit db64241

Please sign in to comment.