Rename files to better indicate that they're tests
This commit is contained in:
parent
e4f37d56a6
commit
a72c33b901
6 changed files with 5 additions and 5 deletions
40
module/__tests__/schemas/stringBucket.test.mjs
Normal file
40
module/__tests__/schemas/stringBucket.test.mjs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import { api } from "../../api.mjs";
|
||||
|
||||
export function stringBucketTests(quench) {
|
||||
quench.registerBatch(
|
||||
`${__ID__}.stringBucketSchema`,
|
||||
(ctx) => {
|
||||
const { describe, it, expect } = ctx;
|
||||
|
||||
describe(`the string bucket schema`, () => {
|
||||
it(`should allow all additional properties to be left out`, () => {
|
||||
const { error } = api.schemas.buckets.string.validate(
|
||||
{ type: `string` },
|
||||
);
|
||||
expect(error).to.be.undefined;
|
||||
});
|
||||
|
||||
it(`should allow specific choices to be provided`, () => {
|
||||
const { error } = api.schemas.buckets.string.validate(
|
||||
{ type: `string`, choices: [`choice 1`, `choice 2`] },
|
||||
);
|
||||
expect(error).to.be.undefined;
|
||||
});
|
||||
|
||||
it(`shouldn't allow specific choices to be empty`, () => {
|
||||
const { error } = api.schemas.buckets.string.validate(
|
||||
{ type: `string`, choices: [] },
|
||||
);
|
||||
expect(error).not.to.be.undefined;
|
||||
});
|
||||
|
||||
it(`should only allow specific choices to be strings`, () => {
|
||||
const { error } = api.schemas.buckets.string.validate(
|
||||
{ type: `string`, choices: [`choice 1`, 5] },
|
||||
);
|
||||
expect(error).not.to.be.undefined;
|
||||
});
|
||||
});
|
||||
},
|
||||
);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue