nuxt3-awesome-starter icon indicating copy to clipboard operation
nuxt3-awesome-starter copied to clipboard

adding jest as unit testing

Open viandwi24 opened this issue 2 years ago • 4 comments

still trying to add jest as unit testing, but still having a lot of problems because I don't really understand jest configuration. maybe someone wants to help with this progress.

jest config

module.exports = {
  preset: 'ts-jest',
  moduleFileExtensions: ['vue', 'js', 'json', 'jsx', 'ts', 'tsx', 'node'],
  transform: {
    '^.+\\.vue$': 'vue-jest',
  },
  testEnvironment: 'jsdom',
  moduleNameMapper: {
    '^@/(.*)$': '<rootDir>/$1',
    '^~/(.*)$': '<rootDir>/$1',
  },
}

viandwi24 avatar Feb 03 '22 08:02 viandwi24

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/viandwi24/nuxt3-awesome-starter/4Dw9RsBE72mZFqaoGhvnzypbhdtv
✅ Preview: https://nuxt3-awesome-starter-git-add-unit-testing-viandwi24.vercel.app

vercel[bot] avatar Feb 03 '22 08:02 vercel[bot]

pr is delayed until the module nuxt3 test has finished. https://github.com/nuxt/framework/pull/2952

pr it will make changes to nuxt/test-utils. use vitest for better performance too.

viandwi24 avatar Feb 03 '22 16:02 viandwi24

Why don't you use vitest?

zuramai avatar Jun 15 '22 22:06 zuramai

yes, as I said in the reply above, waiting for the progress of @nuxt/test-utils to finish in the https://github.com/nuxt/framework/pull/2952 reference.

where jest and vitest config are available, use vitest as the default config. for better performance.

viandwi24 avatar Jun 16 '22 08:06 viandwi24