-
Notifications
You must be signed in to change notification settings - Fork 948
Fix Spec tests 'Limbo documents stay consistent' #1994
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,6 +109,7 @@ import { | |
TEST_PERSISTENCE_PREFIX, | ||
TEST_SERIALIZER | ||
} from '../local/persistence_test_helpers'; | ||
import { MULTI_CLIENT_TAG } from './describe_spec'; | ||
|
||
const ARBITRARY_SEQUENCE_NUMBER = 2; | ||
|
||
|
@@ -1236,6 +1237,7 @@ class IndexedDbTestRunner extends TestRunner { | |
*/ | ||
export async function runSpec( | ||
name: string, | ||
tags: string[], | ||
usePersistence: boolean, | ||
config: SpecConfig, | ||
steps: SpecStep[] | ||
|
@@ -1279,6 +1281,12 @@ export async function runSpec( | |
let count = 0; | ||
try { | ||
await sequence(steps, async step => { | ||
assert( | ||
step.clientIndex === undefined || tags.indexOf(MULTI_CLIENT_TAG) !== -1, | ||
"Cannot use 'client()' to initialize a test that is not tagged with " + | ||
"'multi-client'. Did you mean to use 'spec()'?" | ||
); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if it'd make sense to assert the inverse as well (if this is a multi-client test, then clientIndex must be defined)? Basically:
I don't care strongly if that seems pointless though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not pointless, but not necessarily worth opening an IDE for and fixing since it would not break anything. I'll leave it as an imaginary TODO :) |
||
|
||
++count; | ||
lastStep = step; | ||
return ensureRunner(step.clientIndex || 0).then(runner => | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hrm. Strange that prettier allowed an extra space before...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It didn't. But the change was never pushed.