rockandrollwithemberjs/rarwe-issues

Unable to find expected Mirage Error

Closed this issue · 1 comments

Please make sure you're reporting an error about the latest book version.

Book Version 20220408

Describe the error

In Chapter 11 -> Writing acceptance tests -> Making the first test pass:

I am getting the expected error

Error while processing route: bands.index json.data is not iterable TypeError: json.data is not iterable

but I do not know where to look for the Mirage error. The page says to look at the console, but I do not see that error on either the Chrome DevTools Console nor in the terminal running the test.

Knowing where to find this particular error would be extremely handy! See screenshots below for more details.

Page number
197

The output of ember -v in the project

>> ember -v
ember-cli: 4.1.1
node: 16.13.2
os: linux x64

Additional context

Chrome window running tests with DevTools Console open:
image

VS Code with terminal running tests:
image

Expected error message:

Mirage: Error: You called server.create('band') but no model or factory was found. Make sure you're
passing in the singularized version of the model or factory name.

@pearsehutson

I just rebuilt the Testing chapter from its start and I've found this working. I think what you missed is this:

We have to restart our server because Embroider does not rebuild for changes outside the app folder by default.

So after creating the two Mirage model classes (band and song), you need to restart the test server by ember t --server.

Please let me know if this has fixed it.