mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 20:03:12 +03:00
Fixed node version specific object key sorting (#12817)
refs 74cdbadedb
- Fixes failing test by enforcing ordering through `sort()` call. Doing this to avoid differences between node versions' `Object.keys()` ordering
This commit is contained in:
parent
74cdbadedb
commit
7f50083cc5
@ -49,11 +49,11 @@ describe('DB API', function () {
|
||||
should.exist(jsonResponse.db);
|
||||
jsonResponse.db.should.have.length(1);
|
||||
|
||||
const dataKeys = Object.keys(exportedBodyLatest().db[0].data);
|
||||
const dataKeys = Object.keys(exportedBodyLatest().db[0].data).sort();
|
||||
|
||||
// NOTE: using `Object.keys` here instead of `should.have.only.keys` assertion
|
||||
// because when `have.only.keys` fails there's no useful diff
|
||||
Object.keys(jsonResponse.db[0].data).should.eql(dataKeys);
|
||||
Object.keys(jsonResponse.db[0].data).sort().should.be.eql(dataKeys);
|
||||
});
|
||||
|
||||
it('Can delete all content', async function () {
|
||||
|
@ -68,8 +68,8 @@ describe('Exporter', function () {
|
||||
|
||||
// NOTE: using `Object.keys` here instead of `should.have.only.keys` assertion
|
||||
// because when `have.only.keys` fails there's no useful diff
|
||||
Object.keys(exportData.data).should.eql(tables);
|
||||
Object.keys(exportData.data).should.containDeep(Object.keys(exportedBodyLatest().db[0].data));
|
||||
Object.keys(exportData.data).sort().should.eql(tables.sort());
|
||||
Object.keys(exportData.data).sort().should.containDeep(Object.keys(exportedBodyLatest().db[0].data));
|
||||
exportData.meta.version.should.equal(ghostVersion.full);
|
||||
|
||||
// excludes table should contain no data
|
||||
|
Loading…
Reference in New Issue
Block a user