mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
414344c86c
refs: https://github.com/TryGhost/Toolbox/issues/158 - rather than just exposing any, anything and string matching, expose more specific matchers. - this was triggered by `any(Date)` not working for dates in our API - it seems poor to match `any(String)` for something we want to be a well formatted date - establishes the pattern of using our defined matchers instead of requiring any/anything from jest
23 lines
660 B
JavaScript
23 lines
660 B
JavaScript
const {agentProvider, matchers} = require('../../../utils/e2e-framework');
|
|
const {anyString, stringMatching} = matchers;
|
|
|
|
describe('Site API', function () {
|
|
let agent;
|
|
|
|
before(async function () {
|
|
agent = await agentProvider.getAdminAPIAgent('/ghost/api/canary/admin/');
|
|
});
|
|
|
|
it('can retrieve config and all expected properties', async function () {
|
|
await agent
|
|
.get('site/')
|
|
.matchBodySnapshot({
|
|
site: {
|
|
version: stringMatching(/\d+\.\d+/)
|
|
}
|
|
})
|
|
.matchHeaderSnapshot({
|
|
etag: anyString
|
|
});
|
|
});
|
|
});
|