DefinitelyTyped/types/chai-uuid/chai-uuid-tests.ts
Harm van der Werf 4ed4461b26 Added type definitions for Chai UUID (#25227)
* Added types for Chai UUID

* Fixed the test file

* Removed the message parameter because it's not implemented in the plugin

* Removed an empty namespace as it was unnecessary
2018-04-24 17:06:44 -07:00

16 lines
458 B
TypeScript

import { assert, expect, use, should } from 'chai';
import chaiUuid = require('chai-uuid');
use(chaiUuid);
should();
// bdd style
expect('67cb8aa1-61bb-4b9b-8ca9-9dc0b278d5f7').to.be.uuid('v4');
expect('67cb8aa1-61bb-4b9b-8ca9-9dc0b278d5f7').to.be.guid;
expect('invalid').to.not.be.uuid('v4');
expect('invalid').to.not.be.guid();
// tdd style
assert.uuid('67cb8aa1-61bb-4b9b-8ca9-9dc0b278d5f7', 'v4');
assert.guid('67cb8aa1-61bb-4b9b-8ca9-9dc0b278d5f7');