From d34fc8f906ba6a6958b3e572ef2e5ab46f541e49 Mon Sep 17 00:00:00 2001 From: Dave Lockhart Date: Fri, 4 Aug 2023 12:49:23 -0400 Subject: [PATCH] actually include a separate example for describe --- README.md | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index a141493c..e194de63 100644 --- a/README.md +++ b/README.md @@ -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); }); ```