nrlint
nrlint copied to clipboard
First attempt to add a simple test
This is an attempt to add a very simple unit test to the nrlint rules section of NR Lint.
I have not added it to Dev,
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
Proposed changes
This is my first attempt at creating a simple unit test for NR Lint rules.
Checklist
- [X] I have read the contribution guidelines
- [ ] For non-bugfix PRs, I have discussed this change on the forum/slack team.
The committers are authorized under a signed CLA.
- :white_check_mark: Andreas Markussen (5ef667c0c69e25d9edd997e3b1ae7aead238e15c)
Thanks for the PR @andreasmarkussen.
As we don't currently have any unit tests in this repo we first need to get the basic structure in place for how we want to arrange the tests.
I'm keen that we have some consistency with the other repos in the node-red org. On that basis, I'd suggest:
-
All tests should be in a top-level
test
folder - with a folder structure that mirrors the src structure.That means the test you've added should be in
test/lib/rules/no-duplicate-html-in-url.spec.js
-
We use
should
rather thanchai
elsewhere. I'm not sure why/howchai
came to be listed as an existing dev dependency, it certainly isn't used anywhere I can see in the repo. It may be a legacy dependency from the very early development of the linter.