@hmcts/one-per-page
Advanced tools
Comparing version 3.3.3 to 3.3.6
@@ -5,3 +5,3 @@ { | ||
"homepage": "https://github.com/hmcts/one-per-page#readme", | ||
"version": "3.3.3", | ||
"version": "3.3.6", | ||
"main": "./src/main.js", | ||
@@ -8,0 +8,0 @@ "repository": { |
@@ -23,2 +23,6 @@ const util = require('util'); | ||
} | ||
if (name === 'keys') { | ||
const content = target.getResourceBundle(target.language, `${step.name}`); | ||
return Object.keys(content); | ||
} | ||
const key = `${step.name}:${prefix}`; | ||
@@ -25,0 +29,0 @@ if (toStringKeys.includes(name)) { |
@@ -79,2 +79,3 @@ const { fileExists, readJson, glob } = require('../util/fs'); | ||
const promises = [ | ||
glob('common/*.json').then(loadContents), | ||
glob(`${step.dirname}/content.json`).then(loadContents), | ||
@@ -81,0 +82,0 @@ glob(`${step.dirname}/content.@(*).json`).then(loadContents), |
@@ -18,6 +18,6 @@ const expressSession = require('express-session'); | ||
const userCookie = userOpts.cookie || {}; | ||
const cookie = Object.assign({}, userCookie, { | ||
const cookie = Object.assign({}, { | ||
secure: defaultIfUndefined(userCookie.secure, !isTest), | ||
expires: defaultIfUndefined(userCookie.expires, false) | ||
}); | ||
}, userCookie); | ||
@@ -24,0 +24,0 @@ return { |
@@ -16,4 +16,9 @@ const util = require('util'); | ||
const exists = sinon.stub(); | ||
const getResourceBundle = sinon.stub().returns({ key: 'key' }); | ||
const fakeStep = { name: 'FakeStep' }; | ||
const proxy = new Proxy({ t, exists }, contentProxy(fakeStep)); | ||
const proxy = new Proxy({ | ||
t, | ||
exists, | ||
getResourceBundle | ||
}, contentProxy(fakeStep)); | ||
@@ -99,3 +104,9 @@ beforeEach(() => { | ||
}); | ||
describe('#keys (used by one-per-page-test-suite)', () => { | ||
it('returns all keys for properties', () => { | ||
expect(proxy.foo.keys).to.eql(['key']); | ||
}); | ||
}); | ||
}); | ||
}); |
@@ -73,2 +73,7 @@ const express = require('express'); | ||
}; | ||
supertestObj.text = assertions => { | ||
return supertestObj.then(res => { | ||
return assertions(res.text); | ||
}); | ||
}; | ||
supertestObj.session = assertions => { | ||
@@ -75,0 +80,0 @@ return supertestObj.then(res => { |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
252
1329383
8542
14