We're using (and loving) the jest test framework. Most of our tests are nice compartmentalized good-code-hygiene style unit tests.
However we've also written some service level tests (setting up servers and issuing requests) and also some longer running deployment tests for testing the automation around deploying our stack. These are segregated so that most of the time you just run the first unit tests, but when necessary you can invoke (or CI can) the other longer tests.
Setting up these kinds of integration tests up can be tricky as you sometimes have to work-around (or hack around) limitations of the tools you are using which need testing -- however once you get a good model for it, its not too bad.
Now that many of these things are set up -- I'm having this crazy idea that maybe I should just be using our test framework for actually executing the production deployment process itself ... This way the real deployment logic more exactly matches the testing of that logic. To the extent that actual deployment involves chaining together various components and tools -- why not express that in a manner which allows easily leveraging code from the rest of the project. And the logic that's needed to correctly test variations of the deployment process can just be directly re-used to actually DO the real life deployment -- and keep all the required configuration knobs centralized/verified in a really nice way. Furthermore snapshots can be used to assert all kinds of expectations about the deployment environment and prevent all manner of unexpected sources of variation ...
Does this idea sound crazy? I'm really tempted to try it ... Anybody done this before?