Share your repls and programming experiences

← Back to all posts
ChitChatjs
darkdarcool (132)

Hi! And welcome to one of 2, of my 100 cycle special projects!

I have been working hard on this for the past week, and I would love to show it to you!

This is a jest clone, meaning that a lot of the syntax has been taken from Jest. But, since I just can't copy Jest, and wanted to make a unit tester to help me make a milestone on my journey to becoming a JS dev, I needed to have something different.

So what I did, is I took the syntax from Jest and made it a little bit more beginner-friendly, and made types a lot easier(in my opinion) to use and look at!

Here is a jest example:

function add(num1, num2) {
  return num1 + num2;
}
test('This is an example test', () => {
  expect(add(3, 5)).toBe(8);
})

And in ChitChat:

function add(num1, num2) {
  return num1 + num2;
}
TestCase('This is an example test', add(3, 5), () => {
  return expectToBeNum(5);
});

You see the difference!

ChitChat works best alongside jest!

Contributing

I won't accept contributors, cause this is me learning js, but if I know you, and want you on the project, maybe you'll be invited!

But if you have your heart set on contributing, you can leave suggestions in this GitHub repo!

Credits

  • My Brain, for punching me in the stomach until I did this
  • @darkdarcool(myself), for doing this
  • @RayhanADev, for helping me with the function in the TestCase function
  • @Coder100, for showing me my stupidity and helping with the CLI

Conclusion

Thanks for reading this. If you wanna use this, go ahead. This does not replace jest. I worked hard on this and hope you try it out. If you wanna learn more, go to the docs.

If you want to try this, in the terminal do:

npx chitchatsjs example yourdirname

KTHXBAI!!

Pssst, if you wanna look at the source code, go here
Comments
hotnewtop
JBloves27 (1887)

Noice!

Btw, does it support with multiple arrays in arrays? And does it support comparing values for int and strings? Thanks!

darkdarcool (132)

@JBloves27
Yas, I think. All it does is compare the array you give it. You would need to give it the array you want. And it is strict with types, and it can compare:

bool
array
obj
err(if it throws an error)
int
string
JWZ6 (656)

noice (even though i have no idea y this is so popular)

darkdarcool (132)

@Coder100
Thanks! Also thanks for showing me how stupid I was being!

darkdarcool (132)

@Coder100
;)

also when I got the ping for you commenting is said -1 XD

RayhanADev (2521)

Yessss finally! Kewl project @darkdarcool!