-
-
Notifications
You must be signed in to change notification settings - Fork 796
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
20e174a
commit 675ee69
Showing
80 changed files
with
2,346 additions
and
3,638 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,65 @@ | ||
import assert from 'node:assert' | ||
import { resolve } from 'node:path' | ||
import { env } from 'node:process' | ||
import fetch from 'node-fetch' | ||
import { | ||
joinUrl, | ||
setup, | ||
teardown, | ||
} from '../../integration/_testHelpers/index.js' | ||
|
||
jest.setTimeout(30000) | ||
describe('noPrependStageInUrl option', function desc() { | ||
this.timeout(30000) | ||
|
||
describe('noPrependStageInUrl option', () => { | ||
// init | ||
beforeAll(() => | ||
beforeEach(() => | ||
setup({ | ||
servicePath: resolve(__dirname), | ||
args: ['--noPrependStageInUrl'], | ||
}), | ||
) | ||
|
||
// cleanup | ||
afterAll(() => teardown()) | ||
afterEach(() => teardown()) | ||
|
||
describe('when --noPrependStageInUrl is used, and the stage isnt in the url', () => { | ||
test('it should return a payload', async () => { | ||
const url = joinUrl(TEST_BASE_URL, '/hello') | ||
it('it should return a payload', async () => { | ||
const url = joinUrl(env.TEST_BASE_URL, '/hello') | ||
const response = await fetch(url) | ||
const json = await response.json() | ||
|
||
expect(json).toEqual({ foo: 'bar' }) | ||
assert.deepEqual(json, { foo: 'bar' }) | ||
}) | ||
}) | ||
|
||
describe('when --noPrependStageInUrl is used, and the stage isnt in the url', () => { | ||
test('noPrependStageInUrl 2', async () => { | ||
const url = joinUrl(TEST_BASE_URL, '/dev/hello') | ||
it('noPrependStageInUrl 2', async () => { | ||
const url = joinUrl(env.TEST_BASE_URL, '/dev/hello') | ||
const response = await fetch(url) | ||
const json = await response.json() | ||
|
||
expect(json.statusCode).toEqual(404) | ||
assert.equal(json.statusCode, 404) | ||
}) | ||
}) | ||
}) | ||
|
||
describe('prefix option', () => { | ||
// init | ||
beforeAll(() => | ||
describe('prefix option', function desc() { | ||
this.timeout(30000) | ||
|
||
beforeEach(() => | ||
setup({ | ||
servicePath: resolve(__dirname), | ||
args: ['--prefix', 'someprefix'], | ||
servicePath: resolve(__dirname), | ||
}), | ||
) | ||
|
||
// cleanup | ||
afterAll(() => teardown()) | ||
afterEach(() => teardown()) | ||
|
||
describe('when the --prefix option is used', () => { | ||
test('the prefixed path should return a payload', async () => { | ||
const url = joinUrl(TEST_BASE_URL, '/someprefix/dev/hello') | ||
it('the prefixed path should return a payload', async () => { | ||
const url = joinUrl(env.TEST_BASE_URL, '/someprefix/dev/hello') | ||
const response = await fetch(url) | ||
const json = await response.json() | ||
|
||
expect(json).toEqual({ foo: 'bar' }) | ||
assert.deepEqual(json, { foo: 'bar' }) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.