This repository contains examples of various, often used, and tricky assertions in the common JS assertion tools. The site is built using Astro and Starlight.
The site and pages are generated based on the following content:
-
Introduction (src/content/docs/index.mdx) - The content of the main page. To edit it, edit the file directly.
-
Best Practices (src/content/docs/practices.mdx) - The content of the best practices and anti patterns page. To edit it, edit the file directly.
-
Contribution (src/content/docs/contribution.mdx) - The contribution guideline page content. To edit it, edit the file directly and CONTRIBUTION.md as well.
-
Assertions (src/content/docs/assertions) - The content of the pages related to assertions.
- The main page describing the assertions as a concept is the assertions/index.mdx that can be edited directly.
- In the assertions folder, there should be one folder per assertion group, e.g. equality, relational. In each assertion group folder:
- The main page describing the assertion group is the assertions//index.mdx that can be edited directly.
- The pages of the particular assertions of the group should be added in the folder, e.g. assertions/equality/equal.mdx.
-
Tools (src/content/docs/tools) - The content of the pages related to tools.
- The main page describing the tools in general is the tools/index.mdx that can be edited directly.
- In the tools folder, each tool should have a separate MDX file, e.g. tools/chai.mdx.
-
Examples (src/content/docs/examples) - The folder containing all assertion examples, organized into folders by assertion tools. It is important, that each tools and assertion should have a simple ID, that is used for 4.2. and 5.2., and here for the folder names, and the JavaScript example files in the folders.
For example, to create the assertion example for the Greater Than assertion on the Chai tool, the src/content/docs/examples/chai/greaterThan.js file is created. Note, that the src/content/docs/tools/chai.mdx and the src/content/docs/assertions/relational/greaterThan.mdx files also exist.
Important
Before deploying any feature branches, ensure that the AWS CDK Stack is already deployed.
Currently, this can be verified by checking that no Stack Destroy workflow executions have occurred since the last Stack Deployment workflow execution.
To deploy a feature branch, manually execute the Feature Branch Deployment workflow.
Note
Make sure to select your feature branch from the dropdown before executing the workflow.
Feature branches can be redeployed by re-executing the deployment workflow.
Once a feature branch is merged or no longer needed, clean it up by executing the Feature Branch Cleanup workflow.
The AWS CDK stack sets up the necessary infrastructure for the application. It needs to be deployed only once initially, and then it remains active until explicitly destroyed.
Deploy the stack by manually executing the Stack Deployment workflow.
Destroy the stack manually with the Stack Destroy workflow.
To develop the site locally, use the following commands.
All commands are run from the root of the project, from a terminal:
Command | Action |
---|---|
npm install |
Installs dependencies |
npm run dev |
Starts local dev server at localhost:4321 |
npm run build |
Build your production site to ./dist/ |
npm run preview |
Preview your build locally, before deploying |