Skip to content

Commit

Permalink
feat: add link to ci and babel test (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
Panayotis Procopiou authored Aug 15, 2021
1 parent 9e2c581 commit dc5f7c4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"main": "index.js",
"scripts": {
"test": "npm run lint && NODE_ENV=test c8 mocha",
"test:ci": "NODE_ENV=test mocha",
"lint": "standardx --fix",
"test:ci": "npm run lint && NODE_ENV=test mocha",
"lint": "standardx --fix --verbose",
"release": "release-it --config release-it/config.js"
},
"repository": {
Expand Down Expand Up @@ -58,6 +58,6 @@
]
},
"engines": {
"node": ">= 14"
"node": ">= 14.17.1"
}
}
22 changes: 22 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
const { chai, expect, sinon } = require('../')

// This class only exists to be parsed by standardx
// and ensure Babel is being used.
class Dummy {
test ({ value1, value2 = 2, value3 = null, value4 = {} }) {
this.v1 = value1
this.v2 = value2
this.v3 = value3
this.v4 = value4?.value5?.value6
}
}

describe('main require', function () {
it('exports chai', function () {
expect(chai).to.exist
Expand All @@ -8,4 +19,15 @@ describe('main require', function () {
it('exports sinon', function () {
expect(sinon).to.exist
})

// This test only exists so standardx doesn't
// complain that the Dummy class isn't used.
it('parses code', function () {
var dummy = new Dummy()
dummy.test({ value1: 1, value2: 'not2', value3: 3, value4: { value5: { value6: 4 } } })
expect(dummy.v1).to.eq(1)
expect(dummy.v2).to.eq('not2')
expect(dummy.v3).to.eq(3)
expect(dummy.v4).to.eq(4)
})
})

0 comments on commit dc5f7c4

Please sign in to comment.