This folder contains the test report for the Maester project.
It uses vite-plugin-singlefile to generate a single HTML file which will be used by the Export-MtHtmlReport cmdlet to generate the html report
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
- Node.js version 18.0 or above (which can be checked by running
node -v
). You can use nvm for managing multiple Node versions on a single machine installed. - When installing Node.js, you are recommended to check all checkboxes related to dependencies.
Open terminal window and navigate to /report folder and run the following command to install all dependencies:
npm install
To start the development server, run the following command:
npm run dev
Once you are done with making updates to the report, you can build the project to create the .html template and copy it over to the /powershell folder.
To build the project, run the following command:
npm run build
- This will generate the report.html file in the /dist folder.
- Copy it to the /powershell/assets folder and rename it to ReportTemplate.html (overwrite the existing file).
Copy-Item ./dist/index.html ../powershell/assets/ReportTemplate.html -Force
- Now PowerShell will package and use the new report template.
When making updates to the report you might want to bring in some fresh data to reproduce the issue or use an updated json generated by PowerShell.
- Open the generated test-results.html where you want to bring the data from.
- Search for
const testResults = {
- Collapse the node from the left pane
- Now select and copy all the contents between
const testResults = {
and};
This can be 100s of lines depending on the size of the json. - Open /report/src/App.jsx and search for
const testResults = {
. - Replace the contents between
const testResults = {
and};
in App.jsx with the copied content. - Your report should now show the updated data.