- require
const fsPromises = require('fs').promises; - use
fsPromises.readFileto read a file thenconsole.logthe file
- require
const fsPromises = require('fs').promises; - use
fsPromises.writeFileto write a file thenconsole.log"DONE!"
- require
const fsPromises = require('fs').promises; - use
fsPromises.readFileto read a file thenusefsPromises.writeFileto write the read datathenconsole.log"DONE!"
- create and export a
copy(src, dst)function- require
const fsPromises = require('fs').promises; - use
fsPromises.readFileto read a file thenusefsPromises.writeFileto write the read data- return the promise
- require
- test
- test your copy function
- invoke your copy function
thenexpect that the new file exists- make sure to clean up copied files in an
afterAllorafterEach
- create and export a
transform(src)function- require
const fsPromises = require('fs').promises; - use
fsPromises.readFileto read a file thenremove all capital lettersthenmake all letters capitalthenreverse the string
- require
- test
- invoke your transform function
thenexpect that the result is what you think it should be
Use the Futurama Quote API http://futuramaapi.herokuapp.com
- use
fetchto make a request to http://futuramaapi.herokuapp.com/api/quotes/1 - use
thento wait for the request to resolve and parse json thenprint the output- How would you get more than 1 quote?
- How would you get only quotes by Bender?
- use
fetchto make a request to https://rickandmortyapi.com/api/character/ - use
thento wait for the request to resolve and parse json thenprint the output
- use
fetchto make a request to https://rickandmortyapi.com/api/character/ - use
thento wait for the request to resolve and parse json thenmake another request to retrieve the origin of each character- HINT: use
Promise.all
- HINT: use
- write a
rickAndMortyApi.jsandrickAndMortyApi.test.jsfile - export a function
getCharacterthat takes an id and returns a promise that resolves to a character- return only the characters name, status, and species
- WRITE YOUR TESTS FIRST
- refactor your
getCharacterfunction to use async/await - your tests should still pass without any edits
- export a function
getManyCharactersthat takes an array of ids and returns a promise that resolves with an array of characters- use your
getCharactersfunction from before with aPromise.all
- use your
- WRITE YOUR TESTS FIRST
- refactor your
getManyCharactersfunction to use async/await - your tests should still pass without any edits
- 2 points for
copyfunction - 2 point for
transform - 2 points for
getCharacterfunction - 3 points for
getManyCharactersfunction - 1 point for mocks