kodepandai / lunox

Laravel-Flavoured Nodejs Framework
https://lunox.js.org
MIT License
75 stars 8 forks source link

[lunox-core] Testing Source Code using Vitest #47

Closed axmad386 closed 1 year ago

axmad386 commented 1 year ago

We are using jest and ts-node before to test lunoxjs packages. But it very buggy, since jest esm still experimental. Vitest will solve this problem. This is vitest config, deps.inline is important here so we can directly test the typescript file.

// vitest.config.ts
import { defineConfig } from "vitest/config";
export default defineConfig({
  test: {
    include: ["**/*.test.ts"],
    deps: {
      inline: ["@lunoxjs/core", "@lunoxjs/filesystem"], // add more here
    },
    reporters: "verbose",
  },
});