Skip to content

Commit 6da578a

Browse files
committed
test: updated test validating image config
1 parent 262f0c6 commit 6da578a

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

test/index.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,11 @@ describe('onBuild()', () => {
255255
expect(config.config.env.NEXTAUTH_URL).toEqual(mockUserDefinedSiteUrl)
256256
})
257257

258-
test('sets the NEXTAUTH_URL to the DEPLOY_PRIME_URL when CONTEXT env variable is not \'production\'', async () => {
258+
test("sets the NEXTAUTH_URL to the DEPLOY_PRIME_URL when CONTEXT env variable is not 'production'", async () => {
259259
const mockUserDefinedSiteUrl = chance.url()
260260
process.env.DEPLOY_PRIME_URL = mockUserDefinedSiteUrl
261261
process.env.URL = chance.url()
262-
262+
263263
// See https://docs.netlify.com/configure-builds/environment-variables/#build-metadata for all possible values
264264
process.env.CONTEXT = 'deploy-preview'
265265

@@ -277,8 +277,8 @@ describe('onBuild()', () => {
277277

278278
expect(config.config.env.NEXTAUTH_URL).toEqual(mockUserDefinedSiteUrl)
279279
})
280-
281-
test('sets the NEXTAUTH_URL to the user defined site URL when CONTEXT env variable is \'production\'', async () => {
280+
281+
test("sets the NEXTAUTH_URL to the user defined site URL when CONTEXT env variable is 'production'", async () => {
282282
const mockUserDefinedSiteUrl = chance.url()
283283
process.env.DEPLOY_PRIME_URL = chance.url()
284284
process.env.URL = mockUserDefinedSiteUrl
@@ -300,7 +300,6 @@ describe('onBuild()', () => {
300300

301301
expect(config.config.env.NEXTAUTH_URL).toEqual(mockUserDefinedSiteUrl)
302302
})
303-
304303

305304
test('sets the NEXTAUTH_URL specified in the netlify.toml or in the Netlify UI', async () => {
306305
const mockSiteUrl = chance.url()
@@ -615,7 +614,7 @@ describe('onBuild()', () => {
615614
const imageConfigPath = path.join(constants.INTERNAL_FUNCTIONS_SRC, IMAGE_FUNCTION_NAME, 'imageconfig.json')
616615
const imageConfigJson = await readJson(imageConfigPath)
617616

618-
expect(imageConfigJson.domains.length).toBe(2)
617+
expect(imageConfigJson.domains.length).toBe(1)
619618
expect(imageConfigJson.remotePatterns.length).toBe(1)
620619
expect(imageConfigJson.responseHeaders).toStrictEqual({
621620
'X-Foo': mockHeaderValue,

0 commit comments

Comments
 (0)