Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test setup for prebuild files #183

Open
Tracked by #123 ...
cloverich opened this issue Jun 15, 2024 · 0 comments · May be fixed by #199
Open
Tracked by #123 ...

Test setup for prebuild files #183

cloverich opened this issue Jun 15, 2024 · 0 comments · May be fixed by #199

Comments

@cloverich
Copy link
Owner

cloverich commented Jun 15, 2024

  • Add a test setup for prebuild; support using SQLite in tests; explore node native testing lib vs mocha
  • Add tests for documents search, save, etc (and tags)
  • Integrate it into the testing pipeline

Current test setup is very naive -- it just compiles the full test+dependencies into test files with esbuild, then runs them:

const testFiles = findTestFiles("src");

testFiles.forEach(async (file) => {
  await esbuild.build({
    entryPoints: [file],
    // NOTE: If changing filename, also update findTestFiles glob above to avoid
    // bundled test files being used as source!
    outfile: file.replace(".test.ts", ".test.bundle.js"),
    bundle: true,
    platform: "node",
    external: ["mocha"],
    plugins: [],
  });
});

It is surprisingly fast though -- as esbuild tends to be. I need to extend this setup for prebuild which works in node-land. Should support talking to sqlite so the tests can be real, and specifically test the documents module which creates / finds / saves notes, the core API of the app.

@cloverich cloverich mentioned this issue Jun 15, 2024
19 tasks
This was referenced Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant