Issue when running BookBrainz tests

Hi, after setting up the database succesfully, I tried to run the test suite using the given command in the dev-docs on my upstream forked repository. I received a few dozen linter related errors and a warning based on my TypeScript version and it seems no other test is being run. After trying to change the command in the package.json file, I noticed that the changes don’t apply to the docker container. Any idea on how to run the other tests?

The first screenshot is pretty clear, the linting errors (not warnings) will make the test suite fail (before it is even run). You can see the command failed with exit code 1 here.

For the second screenshot, I see the typescript version warning too, but (at least in your screenshot) I don’t see anything else out of the ordinary, and it doesn’t look like the command failed.
You might just have to wait longer to see the continuation of the output.

The screenshots are part of the same output, first I get the TypeScript warning, then the linter errors. My question is, is it normal for that command to fail even though I’ve made no changes in the code? If not, how can I fix that?
Full error screenshot

@Radulee OK, the screenshots in the right order make more sense :slight_smile:

Well, there isn’t much to it: you have 76 linting errors that need fixing ! That prevents the test suite from running.
Perhaps you IDE is auto-formatting the files on save? If that’s the case you’ll need to disable it, or make it follow our ESLint rules.
The linting check will need to pass if you want to create a pull request.

In the meantime, you can try running only the part of the command that runs the tests:
I haven’t tested it but you can try the command docker-compose run --rm bookbrainz-site yarn run cross-env NODE_ENV=test mocha -r jsdom-global/register

For future reference, it’s always useful to copy the entire logs output and paste it in a pasteboard service like pastebin or similar, it’s more useful than images to be able to diagnose what is happening.

1 Like

Hey @mr_monkey, just solved the linter errors in BB-732. Please have a look