Mirage JS is an API mocking library that lets you build, test and share a complete working JavaScript application without having to rely on any backend services.
Create a Server
The
best DX for frontend development.
Say goodbye to configuring painful backend environments just to hack on your UI. Mirage runs alongside the rest of your frontend code, so there’s no new infrastruture for you to learn.
New collaborators can clone your frontend codebase, run npm install, and have a complete local offline dev environment up and running in seconds – no environment variables or auth tokens needed.
Honestly, I can't recommend this tool enough. Finally, an idiomatic way for frontend developers to prototype and test an entire feature without touching a real API! Productivity just goes through the roof.
Developer at 0588 tech
Write high-level UI tests that stress your networking code.
With Mirage, you can write automated tests against your API no matter what state it’s in. Test how your app handles 0 blog posts, 17, or – – or even how it behaves when your server is slow or responds with an error.
No messy mocking code or handcrafted API respones in your tests. Just real-world scenarios validating the entire functionality of your full application.
async
(
)
=> {
( const {
getByTestId
(
)
=> {
( const {
getByTestId
)
=> {
( const {
getByTestId
( const {
getByTestId
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
render
App /
)
await waitForElementToBeRemoved
(
render
App /
)
await waitForElementToBeRemoved
(
App /
)
await waitForElementToBeRemoved
(
)
await waitForElementToBeRemoved
(
await waitForElementToBeRemoved
(
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
.
toBeInTheDocument
(
)
it
( shows existing todos
async
(
)
it
( shows existing todos
async
)
it
( shows existing todos
async
it
( shows existing todos
async
it
( shows existing todos
async
it
( shows existing todos
async
it
( shows existing todos
async
async
(
{
server
createList
( “todo”
, 3) )
const
{ getByTestId
{
server
createList
( “todo”
, 3) )
const
{ getByTestId
{
server
createList
( “todo”
, 3) )
const
{ getByTestId
server
createList
( “todo”
, 3) )
const
{ getByTestId
( “todo”
, 3) )
const
{ getByTestId
const
{ getByTestId
const
{ getByTestId
{ getByTestId
,
getAllByTestId
render
App
render
App
render
App
render
App
App
. /
(
await waitForElementToBeRemoved
(
await waitForElementToBeRemoved
(
(
(
)
=>
getByTestId ( )
expect
(
getAllByTestId ( “todo”
=>
getByTestId ( )
expect
(
getAllByTestId ( “todo”
=>
getByTestId ( )
expect
(
getAllByTestId ( “todo”
expect
(
getAllByTestId ( “todo”
expect
(
getAllByTestId ( “todo”
getAllByTestId ( “todo”
. toHaveLength
(
it
(
“can complete a todo”
async (
=>
({
server
create ( “todo”
,
{
it
(
“can complete a todo”
async (
=>
({
server
create ( “todo”
,
{
it
(
“can complete a todo”
async (
=>
({
server
create ( “todo”
,
{
it
(
“can complete a todo”
async (
=>
({
server
create ( “todo”
,
{
it
(
“can complete a todo”
async (
=>
({
server
create ( “todo”
,
{
“can complete a todo”
async (
=>
({
server
create ( “todo”
,
{
async (
=>
({
server
create ( “todo”
,
{
=>
({
server
create ( “todo”
,
{
=>
({
server
create ( “todo”
,
{
({
server
create ( “todo”
,
{
server
create ( “todo”
,
{
,
{
text
:
Todo 1
isDone
false
server
create ( “todo”
,
{
isDone
false
server
create ( “todo”
,
{
server
create ( “todo”
,
{
create ( “todo”
,
{
{
text
:
Todo 2
isDone
false
isDone
false
const
{ getByTestId
,
getAllByTestId
render
App
render
App
render
App
render
App
App
. /
(
await waitForElementToBeRemoved
(
await waitForElementToBeRemoved
(
(
(
)
=>
getByTestId ( )
( const todos
=
getAllByTestId (
todo )
userEvent
=>
getByTestId ( )
( const todos
=
getAllByTestId (
todo )
userEvent
=>
getByTestId ( )
( const todos
=
getAllByTestId (
todo )
userEvent
( const todos
=
getAllByTestId (
todo )
userEvent
=
getAllByTestId (
todo )
userEvent
todo )
userEvent
userEvent
userEvent
(
todos
[1]
.
querySelector
.
querySelector
(
“input [type=’checkbox’]”
await waitForElementToBeRemoved
(
await waitForElementToBeRemoved
(
(
(
)
=>
getByTestId ( )
=>
getByTestId ( )
=>
getByTestId ( )
expect
( todos
.
querySelector ( ‘input [type=”checkbox”]’ (checked
toBe
(
false
))
expect
todos
[1]
querySelector
(
‘input [type=”checkbox”]’ ) checked
)
toBe (
true
expect
(server
db . todos
[1]
isDone
toBe
(
querySelector ( ‘input [type=”checkbox”]’ (checked
toBe
(
false
))
expect
todos
[1]
querySelector
(
‘input [type=”checkbox”]’ ) checked
)
toBe (
true
expect
(server
db . todos
[1]
isDone
toBe
(
(
false
))
expect
todos
[1]
querySelector
(
‘input [type=”checkbox”]’ ) checked
)
toBe (
true
expect
(server
db . todos
[1]
isDone
toBe
(
))
expect
todos
[1]
querySelector
(
‘input [type=”checkbox”]’ ) checked
)
toBe (
true
expect
(server
db . todos
[1]
isDone
toBe
(
expect
todos
[1]
querySelector
(
‘input [type=”checkbox”]’ ) checked
)
toBe (
true
expect
(server
db . todos
[1]
isDone
toBe
(
[1]
querySelector
(
‘input [type=”checkbox”]’ ) checked
)
toBe (
true
expect
(server
db . todos
[1]
isDone
toBe
(
(
‘input [type=”checkbox”]’ ) checked
)
toBe (
true
expect
(server
db . todos
[1]
isDone
toBe
(
‘input [type=”checkbox”]’ ) checked
)
toBe (
true
expect
(server
db . todos
[1]
isDone
toBe
(
toBe (
true
expect
(server
db . todos
[1]
isDone
toBe
(
expect
(server
db . todos
[1]
isDone
toBe
(
expect
(server
db . todos
[1]
isDone
toBe
(
expect
(server
db . todos
[1]
isDone
toBe
(
(server
db . todos
[1]
isDone
toBe
(
isDone
isDone
toBe
(
toBe
(
true
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
“can create a todo”
async (
=>
({
( const {
getByTestId
async (
=>
({
( const {
getByTestId
=>
({
( const {
getByTestId
=>
({
( const {
getByTestId
({
( const {
getByTestId
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
render
App /
)
await waitForElementToBeRemoved
(
render
App /
)
await waitForElementToBeRemoved
(
App /
)
await waitForElementToBeRemoved
(
)
await waitForElementToBeRemoved
(
await waitForElementToBeRemoved
(
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
const
newTodoForm
= await
waitForElement
(
()
=>
const
newTodoForm
= await
waitForElement
(
()
=>
= await
waitForElement
(
()
=>
(
()
=>
()
=>
getByTestId
“new-todo-form”
userEvent
type (
newTodoForm
querySelector
(
“input”
)
)
dog ”
fireEvent
submit
(
getByTestId
“new-todo-form”
type (
newTodoForm
querySelector
(
“input”
)
)
dog ”
fireEvent
submit
(
getByTestId
“new-todo-form”
querySelector
(
“input”
)
)
dog ”
fireEvent
submit
(
getByTestId
“new-todo-form”
“input”
)
)
dog ”
fireEvent
submit
(
getByTestId
“new-todo-form”
)
)
dog ”
fireEvent
submit
(
getByTestId
“new-todo-form”
)
dog ”
fireEvent
submit
(
getByTestId
“new-todo-form”
dog ”
fireEvent
submit
(
getByTestId
“new-todo-form”
fireEvent
submit
(
getByTestId
“new-todo-form”
fireEvent
submit
(
getByTestId
“new-todo-form”
submit
(
getByTestId
“new-todo-form”
getByTestId
“new-todo-form”
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
todo
= getByTestId
( “todo” )
expect
todo querySelector ( ‘input [type=”checkbox”]’
.
checked . toBe
(
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
(
(
)
=>
getByTestId ( )
const
todo
= getByTestId
( “todo” )
expect
todo querySelector ( ‘input [type=”checkbox”]’
.
checked . toBe
(
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
(
)
=>
getByTestId ( )
const
todo
= getByTestId
( “todo” )
expect
todo querySelector ( ‘input [type=”checkbox”]’
.
checked . toBe
(
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
=>
getByTestId ( )
const
todo
= getByTestId
( “todo” )
expect
todo querySelector ( ‘input [type=”checkbox”]’
.
checked . toBe
(
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
=>
getByTestId ( )
const
todo
= getByTestId
( “todo” )
expect
todo querySelector ( ‘input [type=”checkbox”]’
.
checked . toBe
(
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
const
todo
= getByTestId
( “todo” )
expect
todo querySelector ( ‘input [type=”checkbox”]’
.
checked . toBe
(
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
const
todo
= getByTestId
( “todo” )
expect
todo querySelector ( ‘input [type=”checkbox”]’
.
checked . toBe
(
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
= getByTestId
( “todo” )
expect
todo querySelector ( ‘input [type=”checkbox”]’
.
checked . toBe
(
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
expect
todo querySelector ( ‘input [type=”checkbox”]’
.
checked . toBe
(
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
expect
todo querySelector ( ‘input [type=”checkbox”]’
.
checked . toBe
(
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
expect
todo querySelector ( ‘input [type=”checkbox”]’
.
checked . toBe
(
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
.
checked . toBe
(
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
toBe
(1
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
db . todos
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
.
text
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
. toBe ( “Walk the dog”
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
it
( shows a message if there are no todos
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
async
(
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
) =>
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
{
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
(
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
(
)
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
=>
getByTestId ( )
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
expect
(
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
getByTestId ( “no-todos”
.
toBeInTheDocument
(
)
it
( shows existing todos
async
.
toBeInTheDocument
(
)
it
( shows existing todos
async
(
)
it
( shows existing todos
async
)
it
( shows existing todos
async
it
( shows existing todos
async
it
( shows existing todos
async
it
( shows existing todos
async
it
( shows existing todos
async
async
(
{
server
createList
( “todo”
, 3) )
const
{ getByTestId ,
getAllByTestId
render
App
{
server
createList
( “todo”
, 3) )
const
{ getByTestId ,
getAllByTestId
render
App
{
server
createList
( “todo”
, 3) )
const
{ getByTestId ,
getAllByTestId
render
App
server
createList
( “todo”
, 3) )
const
{ getByTestId ,
getAllByTestId
render
App
( “todo”
, 3) )
const
{ getByTestId ,
getAllByTestId
render
App
const
{ getByTestId ,
getAllByTestId
render
App
const
{ getByTestId ,
getAllByTestId
render
App
{ getByTestId ,
getAllByTestId
render
App
render
App
render
App
render
App
render
App
App
. /
(
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getAllByTestId ( “todo”
. toHaveLength
(
it
(
“can complete a todo”
async (
=>
({
server
create ( “todo”
,
{
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
(
getAllByTestId ( “todo”
. toHaveLength
(
it
(
“can complete a todo”
async (
=>
({
server
create ( “todo”
,
{
(
(
)
=>
getByTestId ( )
expect
(
getAllByTestId ( “todo”
. toHaveLength
(
it
(
“can complete a todo”
async (
=>
({
server
create ( “todo”
,
{
(
)
=>
getByTestId ( )
expect
(
getAllByTestId ( “todo”
. toHaveLength
(
it
(
“can complete a todo”
async (
=>
({
server
create ( “todo”
,
{
=>
getByTestId ( )
expect
(
getAllByTestId ( “todo”
. toHaveLength
(
it
(
“can complete a todo”
async (
=>
({
server
create ( “todo”
,
{
=>
getByTestId ( )
expect
(
getAllByTestId ( “todo”
. toHaveLength
(
it
(
“can complete a todo”
async (
=>
({
server
create ( “todo”
,
{
expect
(
getAllByTestId ( “todo”
. toHaveLength
(
it
(
“can complete a todo”
async (
=>
({
server
create ( “todo”
,
{
expect
(
getAllByTestId ( “todo”
. toHaveLength
(
it
(
“can complete a todo”
async (
=>
({
server
create ( “todo”
,
{
getAllByTestId ( “todo”
. toHaveLength
(
it
(
“can complete a todo”
async (
=>
({
server
create ( “todo”
,
{
it
(
“can complete a todo”
async (
=>
({
server
create ( “todo”
,
{
it
(
“can complete a todo”
async (
=>
({
server
create ( “todo”
,
{
it
(
“can complete a todo”
async (
=>
({
server
create ( “todo”
,
{
it
(
“can complete a todo”
async (
=>
({
server
create ( “todo”
,
{
(
“can complete a todo”
async (
=>
({
server
create ( “todo”
,
{
async (
=>
({
server
create ( “todo”
,
{
=>
({
server
create ( “todo”
,
{
=>
({
server
create ( “todo”
,
{
({
server
create ( “todo”
,
{
server
create ( “todo”
,
{
create ( “todo”
,
{
{
text
:
Todo 1
isDone
false
server
create ( “todo”
,
{
Todo 1
isDone
false
server
create ( “todo”
,
{
isDone
false
server
create ( “todo”
,
{
server
create ( “todo”
,
{
create ( “todo”
,
{
{
text
:
Todo 2
isDone :
false
)
const
{ getByTestId ,
getAllByTestId
render
App
Todo 2
isDone :
false
)
const
{ getByTestId ,
getAllByTestId
render
App
false
)
const
{ getByTestId ,
getAllByTestId
render
App
)
const
{ getByTestId ,
getAllByTestId
render
App
const
{ getByTestId ,
getAllByTestId
render
App
const
{ getByTestId ,
getAllByTestId
render
App
getAllByTestId
render
App
render
App
render
App
render
App
App
. /
(
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
( const todos
=
getAllByTestId (
todo )
userEvent
(
todos
[1]
.
querySelector
(
“input [type=’checkbox’]”
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
( const todos
=
getAllByTestId (
todo )
userEvent
(
todos
[1]
.
querySelector
(
“input [type=’checkbox’]”
(
(
)
=>
getByTestId ( )
( const todos
=
getAllByTestId (
todo )
userEvent
(
todos
[1]
.
querySelector
(
“input [type=’checkbox’]”
(
)
=>
getByTestId ( )
( const todos
=
getAllByTestId (
todo )
userEvent
(
todos
[1]
.
querySelector
(
“input [type=’checkbox’]”
=>
getByTestId ( )
( const todos
=
getAllByTestId (
todo )
userEvent
(
todos
[1]
.
querySelector
(
“input [type=’checkbox’]”
=>
getByTestId ( )
( const todos
=
getAllByTestId (
todo )
userEvent
(
todos
[1]
.
querySelector
(
“input [type=’checkbox’]”
( const todos
=
getAllByTestId (
todo )
userEvent
(
todos
[1]
.
querySelector
(
“input [type=’checkbox’]”
=
getAllByTestId (
todo )
userEvent
(
todos
[1]
.
querySelector
(
“input [type=’checkbox’]”
todo )
userEvent
(
todos
[1]
.
querySelector
(
“input [type=’checkbox’]”
userEvent
(
todos
[1]
.
querySelector
(
“input [type=’checkbox’]”
userEvent
(
todos
[1]
.
querySelector
(
“input [type=’checkbox’]”
todos
[1]
.
querySelector
(
“input [type=’checkbox’]”
.
querySelector
(
“input [type=’checkbox’]”
“input [type=’checkbox’]”
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
( todos
.
querySelector ( ‘input [type=”checkbox”]’ (checked
toBe
(
false
))
expect
todos
[1]
querySelector
(
‘input [type=”checkbox”]’ ) checked
)
toBe (
true
expect
(server
db . todos
[1]
isDone
toBe
( true
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
expect
( todos
.
querySelector ( ‘input [type=”checkbox”]’ (checked
toBe
(
false
))
expect
todos
[1]
querySelector
(
‘input [type=”checkbox”]’ ) checked
)
toBe (
true
expect
(server
db . todos
[1]
isDone
toBe
( true
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
(
(
)
=>
getByTestId ( )
expect
( todos
.
querySelector ( ‘input [type=”checkbox”]’ (checked
toBe
(
false
))
expect
todos
[1]
querySelector
(
‘input [type=”checkbox”]’ ) checked
)
toBe (
true
expect
(server
db . todos
[1]
isDone
toBe
( true
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
(
)
=>
getByTestId ( )
expect
( todos
.
querySelector ( ‘input [type=”checkbox”]’ (checked
toBe
(
false
))
expect
todos
[1]
querySelector
(
‘input [type=”checkbox”]’ ) checked
)
toBe (
true
expect
(server
db . todos
[1]
isDone
toBe
( true
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
=>
getByTestId ( )
expect
( todos
.
querySelector ( ‘input [type=”checkbox”]’ (checked
toBe
(
false
))
expect
todos
[1]
querySelector
(
‘input [type=”checkbox”]’ ) checked
)
toBe (
true
expect
(server
db . todos
[1]
isDone
toBe
( true
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
=>
getByTestId ( )
expect
( todos
.
querySelector ( ‘input [type=”checkbox”]’ (checked
toBe
(
false
))
expect
todos
[1]
querySelector
(
‘input [type=”checkbox”]’ ) checked
)
toBe (
true
expect
(server
db . todos
[1]
isDone
toBe
( true
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
expect
( todos
.
querySelector ( ‘input [type=”checkbox”]’ (checked
toBe
(
false
))
expect
todos
[1]
querySelector
(
‘input [type=”checkbox”]’ ) checked
)
toBe (
true
expect
(server
db . todos
[1]
isDone
toBe
( true
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
expect
( todos
.
querySelector ( ‘input [type=”checkbox”]’ (checked
toBe
(
false
))
expect
todos
[1]
querySelector
(
‘input [type=”checkbox”]’ ) checked
)
toBe (
true
expect
(server
db . todos
[1]
isDone
toBe
( true
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
.
querySelector ( ‘input [type=”checkbox”]’ (checked
toBe
(
false
))
expect
todos
[1]
querySelector
(
‘input [type=”checkbox”]’ ) checked
)
toBe (
true
expect
(server
db . todos
[1]
isDone
toBe
( true
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
toBe
(
false
))
expect
todos
[1]
querySelector
(
‘input [type=”checkbox”]’ ) checked
)
toBe (
true
expect
(server
db . todos
[1]
isDone
toBe
( true
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
false
))
expect
todos
[1]
querySelector
(
‘input [type=”checkbox”]’ ) checked
)
toBe (
true
expect
(server
db . todos
[1]
isDone
toBe
( true
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
))
expect
todos
[1]
querySelector
(
‘input [type=”checkbox”]’ ) checked
)
toBe (
true
expect
(server
db . todos
[1]
isDone
toBe
( true
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
todos
[1]
querySelector
(
‘input [type=”checkbox”]’ ) checked
)
toBe (
true
expect
(server
db . todos
[1]
isDone
toBe
( true
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
querySelector
(
‘input [type=”checkbox”]’ ) checked
)
toBe (
true
expect
(server
db . todos
[1]
isDone
toBe
( true
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
‘input [type=”checkbox”]’ ) checked
)
toBe (
true
expect
(server
db . todos
[1]
isDone
toBe
( true
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
)
toBe (
true
expect
(server
db . todos
[1]
isDone
toBe
( true
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
true
expect
(server
db . todos
[1]
isDone
toBe
( true
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
expect
(server
db . todos
[1]
isDone
toBe
( true
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
expect
(server
db . todos
[1]
isDone
toBe
( true
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
expect
(server
db . todos
[1]
isDone
toBe
( true
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
db . todos
[1]
isDone
toBe
( true
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
isDone
toBe
( true
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
( true
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
it
(
“can create a todo”
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
(
“can create a todo”
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
async (
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
=>
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
({
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
( const {
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
render
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
App /
)
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
(
(
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
)
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
=>
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
getByTestId ( )
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
const
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
newTodoForm
= await
waitForElement
(
()
=>
getByTestId
waitForElement
(
()
=>
getByTestId
()
=>
getByTestId
=>
getByTestId
“new-todo-form”
userEvent
type (
newTodoForm
querySelector
(
“input”
)
)
dog ”
fireEvent
submit
(
getByTestId
“new-todo-form”
type (
newTodoForm
querySelector
(
“input”
)
)
dog ”
fireEvent
submit
(
getByTestId
“new-todo-form”
querySelector
(
“input”
)
)
dog ”
fireEvent
submit
(
getByTestId
“new-todo-form”
“input”
)
)
dog ”
fireEvent
submit
(
getByTestId
“new-todo-form”
)
)
dog ”
fireEvent
submit
(
getByTestId
“new-todo-form”
)
dog ”
fireEvent
submit
(
getByTestId
“new-todo-form”
dog ”
fireEvent
submit
(
getByTestId
“new-todo-form”
fireEvent
submit
(
getByTestId
“new-todo-form”
fireEvent
submit
(
getByTestId
“new-todo-form”
submit
(
getByTestId
“new-todo-form”
getByTestId
“new-todo-form”
await waitForElementToBeRemoved
(
(
)
=>
getByTestId ( )
const
todo
= getByTestId
( “todo” )
expect
todo querySelector ( ‘input [type=”checkbox”]’
.
checked . toBe
(
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
(
(
)
=>
getByTestId ( )
const
todo
= getByTestId
( “todo” )
expect
todo querySelector ( ‘input [type=”checkbox”]’
.
checked . toBe
(
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
(
)
=>
getByTestId ( )
const
todo
= getByTestId
( “todo” )
expect
todo querySelector ( ‘input [type=”checkbox”]’
.
checked . toBe
(
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
=>
getByTestId ( )
const
todo
= getByTestId
( “todo” )
expect
todo querySelector ( ‘input [type=”checkbox”]’
.
checked . toBe
(
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
=>
getByTestId ( )
const
todo
= getByTestId
( “todo” )
expect
todo querySelector ( ‘input [type=”checkbox”]’
.
checked . toBe
(
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
const
todo
= getByTestId
( “todo” )
expect
todo querySelector ( ‘input [type=”checkbox”]’
.
checked . toBe
(
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
const
todo
= getByTestId
( “todo” )
expect
todo querySelector ( ‘input [type=”checkbox”]’
.
checked . toBe
(
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
= getByTestId
( “todo” )
expect
todo querySelector ( ‘input [type=”checkbox”]’
.
checked . toBe
(
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
expect
todo querySelector ( ‘input [type=”checkbox”]’
.
checked . toBe
(
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
expect
todo querySelector ( ‘input [type=”checkbox”]’
.
checked . toBe
(
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
expect
todo querySelector ( ‘input [type=”checkbox”]’
.
checked . toBe
(
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
.
checked . toBe
(
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
expect
todo querySelector ( ‘input [type=”text”]’ .
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
value
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
.
toBe
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
(
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
“Walk the dog”
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
expect
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
(server
db . todos
length
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
toBe
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
toBe
(1
(1
)
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
expect
(server
db . todos
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
db . todos
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
.
text
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
. toBe ( “Walk the dog”
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
(Share a fully-working UI without running a backend.
Because Mirage realistically mocks out your entire API server, you can share a clickable, working prototype of your JavaScript application without needing to run any backend services.
Get high-quality feedback from your users and iterate faster than ever, before you start investing in expensive server-side infrastructure.
Mehul Kar
Frontend Engineer at Apple
Get started using Mirage
Mirage works with all major JavaScript frameworks, libraries and test runners.
Read More ()
GIPHY App Key not set. Please check settings