mirror of
https://github.com/svg/svgo.git
synced 2025-07-29 20:21:14 +03:00
Migrate to jest (#1520)
Mocha doesn't have a lot of features provided by jest. There is a great assertion library out of the box. And the most cool feature is inline snapshots. Mocha also hides errors which makes debugging a nightmare sometimes.
This commit is contained in:
24
test/jsapi/_index.test.js
Normal file
24
test/jsapi/_index.test.js
Normal file
@ -0,0 +1,24 @@
|
||||
'use strict';
|
||||
|
||||
const { createContentItem } = require('../../lib/svgo.js');
|
||||
const JSAPI = require('../../lib/svgo/jsAPI.js');
|
||||
|
||||
describe('svgo api', function () {
|
||||
it('should has createContentItem method', function () {
|
||||
expect(createContentItem).toBeInstanceOf(Function);
|
||||
});
|
||||
|
||||
it('should be able to create content item', function () {
|
||||
var item = createContentItem({
|
||||
elem: 'elementName',
|
||||
});
|
||||
expect(item).toBeInstanceOf(JSAPI);
|
||||
expect(item.elem).toEqual('elementName');
|
||||
});
|
||||
|
||||
it('should be able create content item without argument', function () {
|
||||
var item = createContentItem();
|
||||
expect(item).toBeInstanceOf(JSAPI);
|
||||
expect(item).toEqual({});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user