Skip to content

lionel-rowe/http-saver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTTP Saver JSR

Save API responses for testing.

Usage

const httpSaver = new HttpSaver()

Deno.test('some API', () => {
    using _ = httpSaver.stubFetch()

    // First time the test runs, the response will be saved under `_fixtures/responses`
    // Subsequent test runs will use the saved response, without making a network request
    const res = await fetch('https://api.example.com')

    // ... do something with `res`
})

About

Save API responses for testing.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published