Skip to content
Snippets Groups Projects
Verified Commit 0e0ba7d6 authored by Kasper Seweryn's avatar Kasper Seweryn :pancakes:
Browse files

Fix most tests

parent 7c68586b
No related branches found
No related tags found
No related merge requests found
......@@ -148,6 +148,9 @@
"^.+\\.js$": "babel-jest",
"^.+\\.ts$": "ts-jest"
},
"transformIgnorePatterns": [
"<rootDir>/node_modules/(?!lodash-es/.*)"
],
"moduleNameMapper": {
"^~/(.*)$": "<rootDir>/src/$1"
},
......
......@@ -19,8 +19,9 @@ export function parseAPIErrors (responseData: APIErrorResponse, parentField?: st
}
const value = responseData[field]
if (value as string[]) {
errors.push(...(value as string[]).map(err => {
if (Array.isArray(value)) {
const values = value as string[]
errors.push(...values.map(err => {
return err.toLocaleLowerCase().includes('this field ')
? `${fieldName}: ${err}`
: err
......
import {expect} from 'chai'
import moment from 'moment'
import {truncate, ago, capitalize, year, unique} from '~/filters'
import {truncate, ago, capitalize, year, unique} from '~/init/filters'
describe('filters', () => {
describe('truncate', () => {
......
var sinon = require('sinon')
import {expect} from 'chai'
import * as _ from 'lodash-es'
import store from '~/store/queue'
import { testAction } from '../../utils'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment