Create a Test
To ensure your API is behaving as expected, create a test against it.
Bruno supports writing tests by through either:
- Assertions to declaratively write tests
- JavaScript
Assertion
To get familiar with testing:
1. open a Collection
2. Select a request
3. Click on the Assertions tab
You can then dictate an expression, operator, and value to test against.

Testing with JavaScript
Bruno also supports writing automation test scripts in JavaScript for more advanced API testing scenarios. By automating your tests, you can increase efficiency and coverage, and integrate testing into CI/CD pipelines.
Example
```js copy test("should be able to login", function () { const data = res.getBody(); expect(res.getStatus()).to.equal(200); });
test("should return json", function () { const data = res.getBody(); expect(res.getBody()).to.eql({ hello: "Bruno", }); }); ```

In this example:
- The first test checks that the response status is 200 (indicating a successful login).
- The second test verifies that the response body is equal to the expected JSON object.