Coder Social home page Coder Social logo

wellwelwel / poku Goto Github PK

View Code? Open in Web Editor NEW
62.0 2.0 6.0 4.67 MB

🐷 Poku makes testing easy for Node.js, Bun & Deno at the same time.

Home Page: https://poku.io

License: MIT License

TypeScript 100.00%
parallel run runner test testing typescript unit sequential bun deno

poku's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar kusmin avatar robertolemesp avatar wellwelwel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

poku's Issues

Transparency: Codecov isn't in line with reality

In fact, all the lines are covered, but not for tests. It's for use, due to my helper tools for rewriting files and ensuring compatibility with Node.js in older versions, Bun and Deno.

To see the actual coverage status, just run npm run test:c8. This will use Docker to ensure that only the final files are tested, but Codecov shows "unknown" status and throws an error when uploading these coverage results for some reason.

Sorry about that, as soon as possible I would like to figure it out 💙

Interoperability with native Node.js test, describe and it

In the same approach for assert, allow users to use all the native approaches in Poku:

From (Node.js homepage):

// tests.mjs
import assert from 'node:assert';
import test from 'node:test';

test('that 1 is equal 1', () => {
  assert.strictEqual(1, 1);
});

test('that throws as 1 is not equal 2', () => {
  // throws an exception because 1 != 2
  assert.strictEqual(1, 2);
});

// run with `node tests.mjs`

To (Poku):

// tests.mjs
import { test, assert } from 'poku';

test('that 1 is equal 1', () => {
  assert.strictEqual(1, 1);
});

test('that throws as 1 is not equal 2', () => {
  // throws an exception because 1 != 2
  assert.strictEqual(1, 2);
});

// run with `npx poku tests.mjs`
  • Same idea for describe and it.

Falha ao rodar os testes no Bun

Descrição da issue

Basicamente quando eu tento executar os testes utilizando o Bun como runtime ele funciona normalmente, mas ao importar algo relacionado ao Bun dentro do arquivo de teste, o poku quebra, simplesmente não executa e crasha sem mensagem de erro.

Primeiramente eu comecei tentando importar o mock do jest de dentro do "bun:test" e crashava, ai tentei importar outras coisas de dentro do bun, de outras bibliotecas do bun e crashava. Não importa o que eu importe, se for diretamente do bun, crasha.

Ambiente

WSL2 Rodando Arch Linux

Como reproduzir

Crie um arquivo de teste, no meu caso, eu criei da seguinte forma:

  • | tests
    • | poku.test.ts

Depois dentro dele, coloque um assert pra testar e antes dele, importe qualquer lib do bun.
Exemplo:

import { assert } from "poku";
import { Database } from "bun:sqlite";

assert(true, "Poku test");

O output desse teste é esse:

error_output

Eu imagino que esse erro seja originado porque os testes são executados com node ao invés do próprio bun, (talvez alguma configuração que eu não soube fazer?).
Quando é usado Typescript, os arquivos são executados com npx tsx e com Javascript, node.
Como ele executa com node e não com o próprio Bun, imagino eu que quebre na hora de importar algo diretamente do Bun.

startScript doesn't end on Bun and Deno

The startScript currently doesn't work for Bun and Deno.

How the startScript works?

  • It will use spawn to start your script in a background process
  • By using .end(), the current process and all its sub-processes will be terminated
  • By forcing finish (Ctrl+C), it will terminate all the background process and all its sub-processes

Expected Behavior

Using Node.js, it will close all subprocesses when closing the main process.

The Issue

However, on Bun and Deno, when the main process is finished, all subprocesses remain open and only the main process is closed.


PRs are welcome 🤝

Improve logs for RegExp and Functions inside arrays

Currently, functions are displayed as it is ("() => {}") and Regex are converted to string ("/rule/"), but the same doesn't is valid when they are inside an array, that shows function as "null" and Regex as "{}".

Allow to limit concurrency in parallel runs

Ideas

CLI

npx poku --parallel --concurrency=3

API (in-code)

await poku(['.'], {
  parallel: true,
  concurrency: 3,
});

Keeping compatibility for previous versions

Use default value as 0 (no limit).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.