-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
Description
Assigning t.context
a value in beforeEach
results in a Flow error.
Test Source
// @flow
test.beforeEach(async (t) => {
t.context = {};
});
Error Message & Stack Trace
test/interceptors/cache/index.js:19
19: t.context = {};
^^^^^^^^^ assignment of property `context`. Property cannot be assigned on any member of intersection type
19: t.context = {};
^ intersection
Member 1:
83: type TestContext = AssertContext & {
^^^^^^^^^^^^^ AssertContext. See: node_modules/ava/index.js.flow:83
Error:
19: t.context = {};
^^^^^^^ property `context`. Property not found in
83: type TestContext = AssertContext & {
^^^^^^^^^^^^^ object type. See: node_modules/ava/index.js.flow:83
Member 2:
83: type TestContext = AssertContext & {
^ object type. See: node_modules/ava/index.js.flow:83
Error:
19: t.context = {};
^^^^^^^ property `context`. Property not found in
83: type TestContext = AssertContext & {
^ object type. See: node_modules/ava/index.js.flow:83
Config
N/A
Command-Line Arguments
N/A
Environment
Node.js v7.7.1
darwin 16.5.0
0.18.2
4.1.2
Metadata
Metadata
Assignees
Labels
No labels