diff --git a/core/server/api/index.js b/core/server/api/index.js index e1795aa3cb..1c7c373dcd 100644 --- a/core/server/api/index.js +++ b/core/server/api/index.js @@ -1,6 +1,10 @@ -module.exports = require('./v3'); -module.exports.canary = require('./canary'); -module.exports.v4 = require('./canary'); +module.exports.shared = require('./shared'); + +const defaultAPI = require('./canary'); + +module.exports = defaultAPI; +module.exports.canary = defaultAPI; +module.exports.v4 = defaultAPI; module.exports.v3 = require('./v3'); module.exports.v2 = require('./v2'); -module.exports.shared = require('./shared'); + diff --git a/test/unit/helpers/next_post.test.js b/test/unit/helpers/next_post.test.js index de7a3b9fc5..d87fbe938a 100644 --- a/test/unit/helpers/next_post.test.js +++ b/test/unit/helpers/next_post.test.js @@ -9,6 +9,7 @@ const api = require('../../../core/server/api'); helpers.next_post = helpers.prev_post; describe('{{next_post}} helper', function () { + const apiVersion = 'canary'; let locals; let browsePostsStub; @@ -16,7 +17,7 @@ describe('{{next_post}} helper', function () { locals = { root: { _locals: { - apiVersion: 'v3' + apiVersion: apiVersion }, context: ['post'] } @@ -147,7 +148,7 @@ describe('{{next_post}} helper', function () { locals = { root: { _locals: { - apiVersion: 'v2' + apiVersion: apiVersion }, context: ['page'] } @@ -191,7 +192,7 @@ describe('{{next_post}} helper', function () { locals = { root: { _locals: { - apiVersion: 'v2' + apiVersion: apiVersion }, context: ['preview', 'post'] } diff --git a/test/unit/helpers/prev_post.test.js b/test/unit/helpers/prev_post.test.js index b83378e1e9..43da50ef4e 100644 --- a/test/unit/helpers/prev_post.test.js +++ b/test/unit/helpers/prev_post.test.js @@ -6,6 +6,7 @@ const helpers = require('../../../core/frontend/helpers'); const api = require('../../../core/server/api'); describe('{{prev_post}} helper', function () { + const apiVersion = 'canary'; let browsePostsStub; let locals; @@ -13,7 +14,7 @@ describe('{{prev_post}} helper', function () { locals = { root: { _locals: { - apiVersion: 'v3' + apiVersion: apiVersion }, context: ['post'] } @@ -142,7 +143,7 @@ describe('{{prev_post}} helper', function () { locals = { root: { _locals: { - apiVersion: 'v2' + apiVersion: apiVersion }, context: ['page'] } @@ -186,7 +187,7 @@ describe('{{prev_post}} helper', function () { locals = { root: { _locals: { - apiVersion: 'v2' + apiVersion: apiVersion }, context: ['preview', 'post'] }