Update azure tests (#26779)
This commit is contained in:
parent
551b6149ce
commit
010a31cf41
2 changed files with 56 additions and 51 deletions
|
@ -111,36 +111,37 @@ stages:
|
|||
- script: |
|
||||
node run-tests.js -g 1/1 --timings --azure --type unit
|
||||
displayName: 'Run tests'
|
||||
|
||||
- job: test_chrome_integration
|
||||
pool:
|
||||
vmImage: 'windows-2019'
|
||||
strategy:
|
||||
matrix:
|
||||
nodejs-1:
|
||||
group: 1/4
|
||||
nodejs-2:
|
||||
group: 2/4
|
||||
nodejs-3:
|
||||
group: 3/4
|
||||
nodejs-4:
|
||||
group: 4/4
|
||||
steps:
|
||||
- checkout: none
|
||||
- script: |
|
||||
wmic datafile where name="C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe" get Version /value
|
||||
displayName: 'List Chrome version'
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: $(node_version)
|
||||
displayName: 'Install Node.js'
|
||||
- task: Cache@2
|
||||
inputs:
|
||||
# use deterministic cache key that is specific
|
||||
# to this test run
|
||||
key: $(Build.SourceVersion)
|
||||
path: $(System.DefaultWorkingDirectory)
|
||||
displayName: Cache Build
|
||||
- script: |
|
||||
node run-tests.js -g $(group) --timings --azure
|
||||
displayName: 'Run tests'
|
||||
# TODO: investigate re-enabling when stability matches running in
|
||||
# tests in ubuntu environment
|
||||
# - job: test_chrome_integration
|
||||
# pool:
|
||||
# vmImage: 'windows-2019'
|
||||
# strategy:
|
||||
# matrix:
|
||||
# nodejs-1:
|
||||
# group: 1/4
|
||||
# nodejs-2:
|
||||
# group: 2/4
|
||||
# nodejs-3:
|
||||
# group: 3/4
|
||||
# nodejs-4:
|
||||
# group: 4/4
|
||||
# steps:
|
||||
# - checkout: none
|
||||
# - script: |
|
||||
# wmic datafile where name="C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe" get Version /value
|
||||
# displayName: 'List Chrome version'
|
||||
# - task: NodeTool@0
|
||||
# inputs:
|
||||
# versionSpec: $(node_version)
|
||||
# displayName: 'Install Node.js'
|
||||
# - task: Cache@2
|
||||
# inputs:
|
||||
# # use deterministic cache key that is specific
|
||||
# # to this test run
|
||||
# key: $(Build.SourceVersion)
|
||||
# path: $(System.DefaultWorkingDirectory)
|
||||
# displayName: Cache Build
|
||||
# - script: |
|
||||
# node run-tests.js -g $(group) --timings --azure
|
||||
# displayName: 'Run tests'
|
||||
|
|
|
@ -917,26 +917,30 @@ describe('Production Usage', () => {
|
|||
expect(missing).toBe(false)
|
||||
})
|
||||
|
||||
it('should preserve query when hard navigating from page 404', async () => {
|
||||
const browser = await webdriver(appPort, '/')
|
||||
await browser.eval(`(function() {
|
||||
window.beforeNav = 1
|
||||
window.next.router.push({
|
||||
pathname: '/non-existent',
|
||||
query: { hello: 'world' }
|
||||
})
|
||||
})()`)
|
||||
if (global.browserName !== 'internet explorer') {
|
||||
it('should preserve query when hard navigating from page 404', async () => {
|
||||
const browser = await webdriver(appPort, '/')
|
||||
await browser.eval(`(function() {
|
||||
window.beforeNav = 1
|
||||
window.next.router.push({
|
||||
pathname: '/non-existent',
|
||||
query: { hello: 'world' }
|
||||
})
|
||||
})()`)
|
||||
|
||||
await check(
|
||||
() => browser.eval('document.documentElement.innerHTML'),
|
||||
/page could not be found/
|
||||
)
|
||||
await check(
|
||||
() => browser.eval('document.documentElement.innerHTML'),
|
||||
/page could not be found/
|
||||
)
|
||||
|
||||
expect(await browser.eval('window.beforeNav')).toBe(null)
|
||||
expect(await browser.eval('window.location.hash')).toBe('')
|
||||
expect(await browser.eval('window.location.search')).toBe('?hello=world')
|
||||
expect(await browser.eval('window.location.pathname')).toBe('/non-existent')
|
||||
})
|
||||
expect(await browser.eval('window.beforeNav')).toBe(null)
|
||||
expect(await browser.eval('window.location.hash')).toBe('')
|
||||
expect(await browser.eval('window.location.search')).toBe('?hello=world')
|
||||
expect(await browser.eval('window.location.pathname')).toBe(
|
||||
'/non-existent'
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
if (!process.env.NEXT_PRIVATE_TEST_WEBPACK4_MODE) {
|
||||
it('should remove placeholder for next/image correctly', async () => {
|
||||
|
|
Loading…
Reference in a new issue