> For the complete documentation index, see [llms.txt](https://gzqsjtu.gitbook.io/workspace/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gzqsjtu.gitbook.io/workspace/test.md).

# Test

## integration testing

## Unit testing

functional testing

## Jest

we hava a xxx.js

create a xxx.test.js

![](/files/-LhhCOs3phLKX_I6c6go)

![](/files/-LhhCTGzaULvWj62E8Om)

#### Using Babel

To use [Babel](http://babeljs.io/), install required dependencies via `yarn`

"dependencies": { "babel-core": "^6.26.3", "babel-jest": "^23.6.0", "babel-preset-env": "^1.7.0", "jest": "^24.0.0" }

![](/files/-LhhChGqfSj8hdG47IAA)

#### Using webpack

Jest can be used in projects that use [webpack](https://webpack.github.io/) to manage assets, styles, and compilation.&#x20;

### Common Matchers

The simplest way to test a value is with exact equality.

```
test('two plus two is four', () => {
  expect(2 + 2).toBe(4);
});
```

![](/files/-Lhhd2zO5jLydIzFFiL9)

![](/files/-LhhkQN87OcqfDahc7jx)

![](/files/-LhhkUOn-tekf4baFO4F)

&#x20;[**Jasmine**](https://jasmine.github.io/)

```
describe("A suite is just a function", function() {
  var a;

  it("and so is a spec", function() {
    a = true;

    expect(a).toBe(true);
  });
});444444
```

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gzqsjtu.gitbook.io/workspace/test.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
