Skip to content

Commit

Permalink
test: add tests on DSToolkit
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaud-moncel committed Jul 18, 2023
1 parent b935861 commit 3ce8c9d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/datasource-toolkit/test/validation/field/field.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import FieldValidator from '../../../src/validation/field';

describe('FieldValidator', () => {
test('should fail with name conataining space', () => {
expect(() => FieldValidator.validateName('collectionName', 'field name')).toThrow(
`The name of field 'field name' you configured on 'collectionName' must not contain space.` +
` Something like 'fieldName' should work has expected.`,
);
});

test('should not fail with a valid name', () => {
expect(() => FieldValidator.validateName('collectionName', 'fieldName')).not.toThrow();
});
});

0 comments on commit 3ce8c9d

Please sign in to comment.