Skip to content

Commit

Permalink
actually include a separate example for describe
Browse files Browse the repository at this point in the history
  • Loading branch information
dlockhart committed Aug 4, 2023
1 parent acbdebe commit d34fc8f
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,32 @@ Tests leverage the familiar [Mocha](https://mochajs.org/) and [Chai](https://www

Tests can be grouped into suites using `describe` and are defined inside `it` blocks.

```javascript
describe('group of tests', () => {
it('should test something', () => {
// ...
});
it('should test something else', () => {
// ...
});
});
```

Results can be verified using either the BDD-style `expect` or TDD-style `assert` syntax (although try not to mix & match).

```javascript
import { expect } from '@brightspace-ui/testing';

describe('group of tests', () => {
it('should multiply numbers', () => {
expect(2 * 4).to.equal(8);
});
it('should multiply numbers', () => {
expect(2 * 4).to.equal(8);
});
```

```javascript
import { assert } from '@brightspace-ui/testing';

describe('group of tests', () => {
it('should multiply numbers', () => {
assert.equal(2 * 4, 8);
});
it('should multiply numbers', () => {
assert.equal(2 * 4, 8);
});
```

Expand Down

0 comments on commit d34fc8f

Please sign in to comment.