Проблема решена, я перешел на Jest.
На самом деле у меня тоже были некоторые проблемы.Проблема заключалась в том, что файлы JavaScript в node_modules не передавались.Рабочая конфигурация ниже.
package.json
{
"name": "myApp",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"start": "ionic-app-scripts serve",
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"test": "jest"
},
"dependencies": {
"@angular/animations": "5.2.11",
"@angular/common": "5.2.11",
"@angular/compiler": "5.2.11",
"@angular/compiler-cli": "5.2.11",
"@angular/core": "5.2.11",
"@angular/forms": "5.2.11",
"@angular/http": "5.2.11",
"@angular/platform-browser": "5.2.11",
"@angular/platform-browser-dynamic": "5.2.11",
"@ionic-native/core": "~4.12.0",
"@ionic-native/splash-screen": "~4.12.0",
"@ionic-native/sqlite": "^4.15.0",
"@ionic-native/status-bar": "~4.12.0",
"@ionic/storage": "2.2.0",
"cordova-sqlite-storage": "^2.4.0",
"ionic-angular": "3.9.2",
"ionicons": "3.0.0",
"moment": "^2.22.2",
"rxjs": "5.5.11",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.26"
},
"devDependencies": {
"@babel/core": "^7.1.0",
"@babel/preset-env": "^7.1.0",
"@ionic/app-scripts": "3.2.0",
"@types/jest": "^23.3.2",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^23.6.0",
"jest": "^23.6.0",
"regenerator-runtime": "^0.12.1",
"ts-jest": "^23.10.2",
"typescript": "~2.6.2"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-sqlite-storage": {}
}
}
}
babel.config.js
'use strict';
module.exports = {
presets: ['@babel/preset-env'],
}
jest.config.js
module.exports = {
"roots": [
"<rootDir>/src"
],
"transform": {
"^.+\\.tsx?$": "ts-jest",
"^.+\\.js?$": "babel-jest" // had to add this
},
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json",
"node"
],
"moduleDirectories": [
"node_modules",
"src"
],
"transformIgnorePatterns": [
"node_modules/(?!(@ionic-native)/)" // had to add this
]
}