cheatcode / joystick

A full-stack JavaScript framework for building stable, easy-to-maintain apps and websites.
https://cheatcode.co/joystick
Other
209 stars 11 forks source link

Documentation: Testing #311

Closed rglover closed 2 months ago

rglover commented 1 year ago

Topics that will need to be covered:

@joystick.js/cli

@joystick.js/test

@joystick.js/ui

@joystick.js/node

rglover commented 1 year ago

Don't forget to mention how to handle errors for various API calls (e.g., uploaders):

test.that('uploader throws error for incorrect file type', async (assert = {}) => {
  const response = await test.uploaders.upload('tester', {
    files: [test.utils.createFile(256, 'blah.txt', 'text/plain')],
  }).catch((error) => error);

  assert.is(response?.errors[0]?.message?.includes('not supported'), true);
});