First steps to a real testing framework: first working version with mocha, chai and doctest-ts

This commit is contained in:
Pieter Vander Vennet 2022-03-14 22:57:01 +01:00
parent edc366149b
commit 4f4fc650b1
42 changed files with 9032 additions and 9275 deletions

View file

@ -657,6 +657,12 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
return bestColor ?? hex;
}
/**
* Reorders an object: creates a new object where the keys have been added alphabetically
*
* const sorted = Utils.sortKeys({ x: 'x', abc: {'x': 'x', 'a': 'a'}, def: 'def'})
* JSON.stringify(sorted) // => '{"abc":{"a":"a","x":"x"},"def":"def","x":"x"}'
*/
static sortKeys(o: any) {
const copy = {}
let keys = Object.keys(o)