Skip to content
This repository was archived by the owner on Dec 27, 2024. It is now read-only.

Commit 8ed2375

Browse files
committed
feat: test engine setup
1 parent 0c2c229 commit 8ed2375

3 files changed

Lines changed: 42 additions & 3 deletions

File tree

lib/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict'
2+
3+
function postmanToOpenApi (input, output, opts) {
4+
console.log(input + output + opts)
5+
}
6+
7+
module.exports = postmanToOpenApi

package.json

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22
"name": "postman-to-openapi",
33
"version": "1.0.0",
44
"description": "Convert postman collection to OpenAPI spec",
5-
"main": "index.js",
5+
"main": "lib/index.js",
66
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1",
7+
"lint": "eslint **/*.js",
8+
"lint:fix": "eslint **/*.js --fix",
9+
"test:unit": "mocha",
10+
"test:unit-no-only": "npm run test:unit -- --forbid-only",
11+
"test": "nyc npm run test:unit-no-only",
812
"changelog:all": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
913
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s"
1014
},
@@ -19,7 +23,7 @@
1923
"collection",
2024
"convert",
2125
"converter",
22-
"trsnaform",
26+
"transform",
2327
"specification",
2428
"yml"
2529
],
@@ -43,5 +47,23 @@
4347
"hooks": {
4448
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
4549
}
50+
},
51+
"nyc": {
52+
"all": true,
53+
"include": [
54+
"lib/**/*.js",
55+
"test/**/*.js"
56+
],
57+
"exclude": [],
58+
"reporter": [
59+
"lcovonly",
60+
"html",
61+
"text"
62+
],
63+
"lines": 90,
64+
"statements": 90,
65+
"functions": 90,
66+
"branches": 90,
67+
"check-coverage": true
4668
}
4769
}

test/index.spec.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'use strict'
2+
3+
const { describe, it } = require('mocha')
4+
const postmanToOpenApi = require('../lib')
5+
6+
describe('First test', function () {
7+
it('test', function () {
8+
postmanToOpenApi('', '', {})
9+
})
10+
})

0 commit comments

Comments
 (0)