Skip to content
This repository has been archived by the owner on Aug 8, 2020. It is now read-only.
This repository has been archived by the owner on Aug 8, 2020. It is now read-only.

Flow TestInterface does not accept exact context type #2

Open
@gajus

Description

@gajus

Description

Flow TestInterface does not accept exact context type.

Test Source

// @flow

/* eslint-disable ava/use-test, no-unused-vars */

import untypedTest from 'ava';
import type {
  TestInterface
} from 'ava';

type ServerType = {||};

const test: TestInterface<ServerType> = untypedTest;

Error Message & Stack Trace

Cannot assign untypedTest to test because inexact object type [1] is incompatible with exact ServerType [2] in type
argument Context [3].

        test/integration.js
          9│
         10│ type ServerType = {||};
         11│
    [2]  12│ const test: TestInterface<ServerType> = untypedTest;
         13│

        node_modules/ava/index.js.flow
 [3][1] 461│ export interface TestInterface<Context = {}> {

Environment

Tell us which operating system you are using, as well as which versions of Node.js, npm, and AVA. Run the following to get it quickly:

node -e "var os=require('os');console.log('Node.js ' + process.version + '\n' + os.platform() + ' ' + os.release())"
ava --version
npm --version
Node.js v10.5.0
darwin 17.4.0
1.0.0-beta.6
6.1.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions