ava Questions

3

Solved

I'm trying to migrate from AVA to Jest. In AVA you can set ava.setup, in which you set the jsdom environment. For example, creating the DOM structure and doing necessary polyfills (localStorage). H...
Hirza asked 5/12, 2016 at 9:17

4

I'm running a test called create admin. The test will first create admin, then check if the admin was created successfully. In the script, I have a part of code where I want to wait for 3 seconds b...
Qualified asked 2/11, 2021 at 6:46

7

Solved

I get the following error, when testing some javascript code, transpiled from a typescript file. Here is the error: Error: _mapAction2.default is not a constructor Here is the line of code that...
Godoy asked 7/3, 2017 at 15:42

3

Solved

I'm using AVA + sinon to build my unit test. Since I need ES6 modules and I don't like babel, I'm using mjs files all over my project, including the test files. I use "--experimental-modules" argum...
Mark asked 8/6, 2018 at 14:54

5

Solved

I followed the docs to create my first test using ava but it doesn't seem to run properly. I get the error below. I tried adding import 'babel-register'; at the top of the file, and it works, but o...
Reed asked 17/1, 2017 at 8:16

5

I have the following situation: A.js import fetch from 'node-fetch' import httpClient from './myClient/httpClient' export default class{ async init(){ const response = await fetch('some_url')...
Mintun asked 14/5, 2017 at 5:20

2

Solved

I have a couple of tests I'd like to run on the .then and .catch blocks of one of my dependencies. import test from 'ava'; import sinon from 'sinon'; // Fake dependency code - this would be impor...
Jettiejettison asked 18/6, 2016 at 19:9

3

I have a project with expressjs and ava, and I'm using webpack in order bundle the app webpack is also load environment variables from .env files based on the NODE_ENV. How can I load .env file ...
Flour asked 25/10, 2017 at 11:12

3

Solved

I write an Electron app that uses nodegit. For my test part I use ava in combination with Spectron to test my app. All of my tests work - including functions which use nodegit in my app. In additio...
Soursop asked 31/10, 2020 at 19:46

2

Solved

Can I ignore a setup or support folder so that ava doesn't try to run the files inside? I have some common utility files used for mocking that should logically live inside the test/ folder alongsid...
Absorption asked 5/7, 2019 at 12:32

2

Solved

I'm looking at the AVA test runner, and it's concurrency feature seems pretty compelling. However, I'm used to Mocha, where you can organize your tests like so: describe('Some Class', () => { ...
Alister asked 21/12, 2016 at 18:1

1

Solved

I declare an event bus in my global app.js like so: window.Event = new Vue(); The component looks like export default { data() { return { hasError: false, zip: '', }; }, methods: { set...
Accession asked 10/5, 2017 at 7:49

1

I'm trying to get nyc ava and babel to all place nice together. I was having an issue where async / await branches were showing as not covered, so this was working, I'm having trouble integrating t...
Moor asked 6/9, 2017 at 16:22

1

Solved

I have been trying to write unit test in javascript for the method which uses jwt token validation. So the results are fetched only if the token is valid. I want to mock the jwt token and return r...
Unilateral asked 19/2, 2018 at 8:21

0

Context I have Frontend React+Webpack app consuming backend APIs. My Webpack setup depends on window.location.origin the property, for setting up and deployment processes. Currently, I'm using Kar...
Calcareous asked 23/10, 2017 at 20:32

1

Solved

My problem ava logging (t.log) only work inside a test, but not during setup (before, beforeEach) or teardown (after*) functions. This means that meaningful setup / teardown data, which is very u...
ava
Ramify asked 24/9, 2017 at 21:23

1

Solved

My group is building an application with the following front-end stack: VueJS Webpack 2.2 AvaJS (for unit testing) nyc (Istanbul) for test coverage We started off with vue-cli to create a Webpa...
Kellyekellyn asked 22/5, 2017 at 19:13

3

Solved

So ava comes with build-in ES2015 support, which works fine for my actual test files. However, when I do import {newUser, createUser, login} from './helpers/user'; I can't use import and export ...
ava
Stillwell asked 19/4, 2016 at 13:46

1

Solved

I'm trying to test a computed property of a Vue.js component using AVA and Avoriaz. I can mount the component and access the data properties fine. When I try an access a computed property, the fun...
Litalitany asked 13/3, 2017 at 16:39

2

I writing tests for my actions, that using { browserHistory } from 'react-router'; And when i'm running my tests, imported browserHistory is undefined for unknown reasons. Therefore, test throw...

1

I'm trying to have source files (and their dependencies in node_modules) be transpiled when running AVA tests. I've configured AVA to require babel-register and inherit my .babelrc file with the fo...
Prostomium asked 26/4, 2016 at 6:45
1

© 2022 - 2024 — McMap. All rights reserved.