Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
Basic updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jsumners committed Mar 27, 2022
1 parent 7eb52e4 commit 29b26c6
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 32 deletions.
4 changes: 0 additions & 4 deletions .taprc

This file was deleted.

5 changes: 5 additions & 0 deletions .taprc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
check-coverage: false

files:
- 'index.test.js'
- 'lib/**/*.test.js'
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const { Ber } = require('asn1')
const { Ber } = require('@ldapjs/asn1')
const Control = require('./lib/control')

module.exports = {
Expand Down
6 changes: 3 additions & 3 deletions test/index.test.js → index.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict'

const tap = require('tap')
const { BerReader, BerWriter } = require('asn1')
const controls = require('../')
const { BerReader, BerWriter } = require('@ldapjs/asn1')
const controls = require('.')

tap.test('#getControl', t => {
t.test('requires a BER to parse', async t => {
Expand All @@ -16,7 +16,7 @@ tap.test('#getControl', t => {

t.test('returns null for empty BER', async t => {
const result = controls.getControl(new BerReader(Buffer.alloc(0)))
t.is(result, null)
t.equal(result, null)
})

t.test('parses a BER (control)', async t => {
Expand Down
2 changes: 1 addition & 1 deletion lib/control.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const { BerWriter } = require('asn1')
const { BerWriter } = require('@ldapjs/asn1')

module.exports = Control

Expand Down
18 changes: 9 additions & 9 deletions test/lib/control.test.js → lib/control.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict'

const tap = require('tap')
const { BerWriter } = require('asn1')
const Control = require('../../lib/control')
const { BerWriter } = require('@ldapjs/asn1')
const Control = require('./control')

tap.test('contructor', t => {
t.test('new no args', function (t) {
Expand Down Expand Up @@ -35,7 +35,7 @@ tap.test('#toBer', t => {
const control = Control()
const ber = control.toBer()

t.is(Buffer.compare(ber.buffer, target.buffer), 0)
t.equal(Buffer.compare(ber.buffer, target.buffer), 0)
})

t.test('converts instance to BER', async t => {
Expand All @@ -53,7 +53,7 @@ tap.test('#toBer', t => {
})
const ber = control.toBer()

t.is(Buffer.compare(ber.buffer, target.buffer), 0)
t.equal(Buffer.compare(ber.buffer, target.buffer), 0)
})

t.test('converts instance to BER (side effect manner)', async t => {
Expand All @@ -72,7 +72,7 @@ tap.test('#toBer', t => {
const ber = new BerWriter()
control.toBer(ber)

t.is(Buffer.compare(ber.buffer, target.buffer), 0)
t.equal(Buffer.compare(ber.buffer, target.buffer), 0)
})

t.test('converts instance to BER with string value', async t => {
Expand All @@ -90,7 +90,7 @@ tap.test('#toBer', t => {
})
const ber = control.toBer()

t.is(Buffer.compare(ber.buffer, target.buffer), 0)
t.equal(Buffer.compare(ber.buffer, target.buffer), 0)
})

t.test('passes through _toBer', async t => {
Expand All @@ -105,7 +105,7 @@ tap.test('#toBer', t => {
control._toBer = (ber) => t.ok(ber)
const ber = control.toBer()

t.is(Buffer.compare(ber.buffer, target.buffer), 0)
t.equal(Buffer.compare(ber.buffer, target.buffer), 0)
})

t.end()
Expand All @@ -120,13 +120,13 @@ tap.test('#toString', t => {
return 'foo'
}
const str = control.toString()
t.is(str, 'foo')
t.equal(str, 'foo')
})

t.test('returns basic object', async t => {
const control = Control({ type: '1.2.3', criticality: false, value: 'foo' })
const str = control.toString()
t.deepEqual(str, {
t.same(str, {
controlType: '1.2.3',
criticality: false,
controlValue: 'foo'
Expand Down
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"name": "@ldapjs/controls",
"version": "1.0.0",
"version": "1.0.0-rc.1",
"description": "LDAP control objects",
"main": "index.js",
"scripts": {
"lint": "standard | snazzy",
"lint:ci": "standard",
"test": "tap --no-cov",
"test:cov": "tap",
"test:cov:html": "tap --coverage-report=html"
"test": "tap --no-coverage-report -R terse",
"test:cov": "tap -R terse",
"test:cov:html": "tap -R terse --coverage-report=html",
"test:watch": "tap -w --no-coverage-report -R terse"
},
"repository": {
"type": "git",
Expand All @@ -24,17 +25,16 @@
},
"homepage": "https://github.com/ldapjs/controls#readme",
"devDependencies": {
"husky": "^3.0.4",
"snazzy": "^8.0.0",
"standard": "^14.1.0",
"tap": "^14.6.1"
"@fastify/pre-commit": "^2.0.2",
"snazzy": "9.0.0",
"standard": "16.0.4",
"tap": "16.0.1"
},
"dependencies": {
"asn1": "^0.2.4"
"@ldapjs/asn1": "^1.0.0"
},
"husky": {
"hooks": {
"pre-commit": "npm run lint && npm run test"
}
}
"pre-commit": [
"lint",
"test"
]
}

0 comments on commit 29b26c6

Please sign in to comment.