Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Hapi Lab with node-test for test runner #1589

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

Cruikshanks
Copy link
Member

DEFRA/water-abstraction-team#130

We as a team would love to move the water-abstraction-system project to use ECMAScript Modules (ESM). The one thing that has held us back is our test framework Hapi Lab.

We've worked hard over the last year restructuring how we build our tests and moving away from our dependence on the database.

This means we are now ready to make the switch to a test framework that natively supports ESM. We've opted for node-test.

In this change, we

  • remove the Hapi Lab dependency
  • update all tests to require node-test
  • update our scripts to use node-test

@Cruikshanks Cruikshanks added the housekeeping Refactoring, tidying up or other work which supports the project label Dec 30, 2024
@Cruikshanks Cruikshanks self-assigned this Dec 30, 2024
DEFRA/water-abstraction-team#130

We as a team would love to move the [water-abstraction-system](https://github.com/DEFRA/water-abstraction-system) project to use [ECMAScript Modules (ESM)](https://nodejs.org/api/esm.html). The one thing that has held us back is our test framework [Hapi Lab](https://hapi.dev/module/lab/).

We've worked hard over the last year restructuring how we build our tests and [moving away from our dependence on the database](DEFRA/water-abstraction-team#124).

This means we are now ready to make the switch to a test framework that natively supports ESM. We've opted for [node-test](https://nodejs.org/api/test.html#test-runner).

In this change we

- remove the **Hapi Lab** dependency
- update all tests to require **node-test**
- update our scripts to use **node-test**
This removed the dependence in some of the model tests on verifying a model was 'right' by checking the length of a returned query and asserting that the expected result was always at position `[0]` in the array.
Looks like we were piggy backing on a dependency Hapi lab or something it was using was brining in!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
housekeeping Refactoring, tidying up or other work which supports the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant