-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Implement JS/no-JS tests #218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
59919fc
add startGlobal option
Rich-Harris f974281
implement js/no-js tests
Rich-Harris 065626d
fix skip/only
Rich-Harris 7aea942
add comment
Rich-Harris e1dd3ad
hydrate error pages
Rich-Harris 1d1c94d
fix visit helper
Rich-Harris 2dbee68
all tests passing
Rich-Harris File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,8 +1,10 @@ | ||
export default function (test) { | ||
test('calls a delete handler', async ({ visit, wait_for_text, click }) => { | ||
await visit('/delete-route'); | ||
test('calls a delete handler', async ({ visit, wait_for_text, click, js }) => { | ||
if (js) { | ||
await visit('/delete-route'); | ||
|
||
await click('.del'); | ||
await wait_for_text('h1', 'deleted 42'); | ||
await click('.del'); | ||
await wait_for_text('h1', 'deleted 42'); | ||
} | ||
}); | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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,18 +1,18 @@ | ||
import * as assert from 'uvu/assert'; | ||
|
||
export default function (test) { | ||
test('page store functions as expected', async ({ visit, page, click, text, wait_for_text }) => { | ||
test('page store functions as expected', async ({ visit, evaluate, click, text, wait_for_text, js }) => { | ||
await visit('/store/'); | ||
|
||
assert.equal(await text('h1'), 'Test'); | ||
assert.equal(await text('h2'), 'Called 1 time'); | ||
assert.equal(await text('h2'), 'Calls: 1'); | ||
|
||
await click('a[href="result"]'); | ||
|
||
await wait_for_text('h1', 'Result'); | ||
await wait_for_text('h2', 'Called 1 time'); | ||
await wait_for_text('h2', js ? 'Calls: 1' : 'Calls: 0'); | ||
|
||
const oops = await page.evaluate(() => window.oops); | ||
const oops = await evaluate(() => window.oops); | ||
assert.ok(!oops, oops); | ||
}); | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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,6 +1,9 @@ | ||
module.exports = { | ||
// By default, `npm run build` will create a standard Node app. | ||
// You can create optimized builds for different platforms by | ||
// specifying a different adapter | ||
adapter: '@sveltejs/adapter-node' | ||
// TODO adapterless builds | ||
adapter: '@sveltejs/adapter-node', | ||
|
||
// this creates `window.start` which starts the app, instead of | ||
// it starting automatically — allows test runner to control | ||
// when hydration occurs | ||
startGlobal: 'start' | ||
}; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.