Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cutest

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cutest

The CUTEST testing framework

  • 0.1.9
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

cute The CUTEST Testing Framework

Uncluttered, concurrent tests

No set-up, no global variables. Just run the test file in any environment and the cutest logs will appear in your console. That's it.

import test from 'cutest'

test('Comparing 1 and 1', async function test1 (t) {
  t.assert(Number('1') === 1, '"1" equals 1')
})

test('This one is gonna fail', async function test3 (t) {
  t.assert(Number('One') === 1, 'One equals 1')
  t.log('Assertions don\'t break the computation')
  throw new Error('Only Exceptions breaks the computation!')
})

test('Compare Json', async function test2 (t) {
  t.compare({ a: 1 }, { a: 1 }, 'Compare two Json objects')
  t.compare({ a: 1 }, { a: 2 }, 'Compare two Json objects')
  t.compare({ a: 1 }, { a: 1, b: 4 }, 'Compare two Json objects')
  t.compare('rocks!!!', 'CUTEST rocks', 'Compare two Strings')
  t.compare([1, 2, 3], [1, 2], 'Compare Arrays')
})

Demo

Node Ninja Tricks

Execute Script Once

node test.js

Live Reload with nodemon

nodemon test.js

Chrome DevTools Debugging with nodemon

You already know this one:

node --inspect --debug-brk test.js

Now go to chrome://inspect/#devices and click on "Open dedicated DevTools for Node". You didn't know about this one, didn't you? Now you don't have to copy-paste the DevTools link anymore. It is automatically attached to the chrome browser.

Now combine this with nodemon:

nodemon --inspect --debug-brk test.js

Best node debugging ever!

Secret Browser Testing Moves

Just include the test script in your HTML file. If you don't have one, we got a nice live-reload server for you:

cutest test.js --open

It's not Karma. But hey, it's not Karma!! (If you know what I mean..)

License

MIT © Kevin Jahns

Keywords

FAQs

Package last updated on 15 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc