jest js выдает ошибку как `TypeError: _App.default не является конструктором` - PullRequest
0 голосов
/ 25 марта 2020

вот мой файл класса в 'App. js'

import CardList from './CardList';

 export default class App {

    constructor() {
        this.cards = [];
        this.addCard = this.addCard.bind(this);
    }

    addCard(data) {
        this.cards = [...this.cards, data];
        CardList(this.cards);
    }
}

My Spe c file:

import App from './App';

describe('app tests goes here', () => {

    beforeEach(() => {})

})

Но как только я запускаю тест ' тест пряжи ', получая ошибку как:

  TypeError: _App.default is not a constructor

      3 |
      4 |
    > 5 | const app = new App();
        |             ^

как это исправить? в чем здесь проблема? кто-нибудь, помогите мне понять, пожалуйста?

мой spe c файл: я еще не начал работать ..

import App from './App';

describe('app tests goes here', () => {

    beforeEach(() => {})

})
...