@lano/morpheus
v0.7.0
Published
Export your [Insomnia](https://insomnia.rest) workspace and test it in command line.
Readme
Morpheus
Export your Insomnia workspace and test it in command line.

Installation
yarn add -DE @lano/morpheus jestCreate a morpheus.config.js and put this content
// morpheus.config.js
module.exports = {
verbose: true,
rootDir: __dirname,
snapshotResolver: "<rootDir>/node_modules/@lano/morpheus/snapshotResolver.js",
testMatch: ["<rootDir>/node_modules/@lano/morpheus/tests/morpheus.spec.js"],
testPathIgnorePatterns: []
};Usage
By default Morpheus search look for a file named /Insomnia.*\.json/i
{
"scripts": {
"test:api": "jest --config=morpheus.config.js"
}
}Example
The generated snapshot will look like the following. Keep in mind that the date header is removed to not break the snapshots.
Object {
"body": "OK",
"description": "",
"headers": Object {
"connection": "close",
"content-length": "2",
"content-type": "text/plain; charset=utf-8",
},
"statusCode": 200,
"url": "http://localhost:5000/auth/basic",
}To do
In file.ts take the most recent file using fs.statSync is there are multiples Insomnia files
