1
0
mirror of https://github.com/simple-icons/simple-icons.git synced 2025-11-23 21:34:49 +02:00

Switch testing framework from jest to uvu (#6915)

* switch from jest to uvu

* remove jest config

* convert index.test.js to uvu

* use assert.type

* Get rid of jest-diff

* Remove uneeded splits

* remove out.txt

* switch to fake-diff
This commit is contained in:
Sachin Raja
2021-11-29 00:44:36 -08:00
committed by GitHub
parent 1cbffee407
commit a14e03cf7a
5 changed files with 76 additions and 80 deletions

View File

@@ -8,7 +8,7 @@
const fs = require('fs');
const path = require('path');
const { diffLinesUnified } = require('jest-diff');
const fakeDiff = require('fake-diff');
const UTF8 = 'utf8';
@@ -58,15 +58,7 @@ const TESTS = {
const dataString = fs.readFileSync(dataFile, UTF8).replace(/\r\n/g, '\n');
const dataPretty = `${JSON.stringify(data, null, ' ')}\n`;
if (dataString !== dataPretty) {
const dataDiff = diffLinesUnified(
dataString.split('\n'),
dataPretty.split('\n'),
{
expand: false,
omitAnnotationLines: true,
},
);
const dataDiff = fakeDiff(dataString, dataPretty);
return `Data file is formatted incorrectly:\n\n${dataDiff}`;
}
},