diff --git a/jest.config.js b/jest.config.js index 0806601..b7f58fc 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,10 +1,12 @@ module.exports = { transform: { - '^.+\\.js$': 'babel-jest', + '^.+\\.m?js$': 'babel-jest', '^.+\\.svelte$': 'jest-transform-svelte', }, - transformIgnorePatterns: ['/node_modules/(?!lodash-es).+\\.js$'], - moduleFileExtensions: ['js', 'svelte'], + transformIgnorePatterns: [ + '/node_modules/(?!(lodash-es|svelte-writable-derived)).+\\.m?js$', + ], + moduleFileExtensions: ['js', 'svelte', 'mjs'], roots: ['/tests'], bail: false, verbose: false, diff --git a/package.json b/package.json index 7c1acb2..93c25e5 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,8 @@ "yup": "0.27.0" }, "dependencies": { - "lodash-es": "^4.17.15" + "lodash-es": "^4.17.15", + "svelte-writable-derived": "^2.0.1" }, "scripts": { "prettier": "prettier --check '**/*.{svelte, html, css, scss, stylus, js, ts, json, yml, md}' --plugin-search-dir=.", diff --git a/src/App.svelte b/src/App.svelte index d2943f4..744da03 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -19,15 +19,6 @@ user: { email: 'test@user.com' }, }); }, 2000); - - /** - * { - * email: 'email@example.com', - * password: '123456', - * language: 'svelte', - * os: ['osx', 'linux'] - * } - */ } const schema = yup.object().shape({ @@ -38,7 +29,10 @@ .email(), password: yup.string().min(4), language: yup.string().required(), - os: yup.string().required(), + os: yup + .array() + .of(yup.string().required()) + .min(2), }), }); @@ -92,7 +86,7 @@ placeholder="Password" multiline />