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

Flow libdef only works with ESM, not CommonJS #3

@yeiniel

Description

@yeiniel

Description

Currently Flow libdef definition shipped with ava 1.0.0-beta.3 do not support using ava as a Commonjs module. I realize that ava recommend using babel but the project source code do not use babel. I know that when running ava babel is implicitly used but i don't think using different EcmaScript flavours is correct.

Test Source

/** Test case for the package entry point */

// @flow

"use strict";

const test = require("ava");
const mlTrainerApi = require(".");

test("expose the Application symbol", t => {
  t.truthy(mlTrainerApi.Application);
});

Error Message & Stack Trace

Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/index.test.js:10:1

Cannot call test because a callable signature is missing in module ava [1].

 [1]  7│ const test = require("ava");
      8│ const mlTrainerApi = require(".");
      9│
     10│ test("expose the Application symbol", t => {
     11│   t.truthy(mlTrainerApi.Application);
     12│ });
     13│



Found 1 error

Config

None

Command-Line Arguments

Copy your npm build scripts or the ava command used:

npx flow check

Environment

Node.js v8.10.0
linux 4.15.0-12-generic
ava version 1.0.0-beta.3
npm version 5.6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions