1
0
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:
Bogdan Chadkin
2021-08-12 18:06:10 +03:00
committed by GitHub
parent 862c43ec64
commit c3695ae533
12 changed files with 2979 additions and 621 deletions

View File

@ -1,6 +1,5 @@
'use strict';
const { expect } = require('chai');
const { visit, detachNodeFromParent } = require('./xast.js');
const getAst = () => {
@ -57,7 +56,7 @@ describe('xast', () => {
},
},
});
expect(entered).to.deep.equal([
expect(entered).toEqual([
'root',
'element:g',
'element:rect',
@ -81,7 +80,7 @@ describe('xast', () => {
},
},
});
expect(exited).to.deep.equal([
expect(exited).toEqual([
'element:rect',
'element:circle',
'element:g',
@ -103,6 +102,6 @@ describe('xast', () => {
},
},
});
expect(entered).to.deep.equal(['g', 'ellipse']);
expect(entered).toEqual(['g', 'ellipse']);
});
});