dimanche 29 janvier 2017

Node Ava getting undefined when importing

I am running ava as testing and when I import certain variable to test.js it is throwing error saying that variable is undefined. On my test.js

    import {valid, input} from './dependency.js';
    test("one plus one is two", t => {
    t.deepEqual(input, output);
    })

It throws input is undefined.

In Dependency.js

    module.exports = {valid, input};
    var input = ["Test", "Hello World"];

My package.json

{
  "name": "assessment",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "ava"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "ava": "^0.17.0"
  }
}

Aucun commentaire:

Enregistrer un commentaire