-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ba84479
commit 8733267
Showing
7 changed files
with
9,695 additions
and
13,812 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
import { commonParent } from './commonParent' | ||
|
||
describe('commonParent()', () => { | ||
it('should return the common parent directory', () => | ||
expect( | ||
import { commonParent } from './commonParent.js' | ||
import { describe, it } from 'node:test' | ||
import assert from 'node:assert/strict' | ||
void describe('commonParent()', () => { | ||
void it('should return the common parent directory', () => | ||
assert.equal( | ||
commonParent([ | ||
'/some/dir/lambda/onMessage.ts', | ||
'/some/dir/lambda/notifyClients.ts', | ||
'/some/dir/lambda/wirepasPublish.ts', | ||
'/some/dir/wirepas-5g-mesh-gateway/protobuf/ts/data_message.ts', | ||
]), | ||
).toEqual('/some/dir/')) | ||
it('should return the entire parent tree for a single file', () => | ||
expect(commonParent(['/some/dir/lambda/onMessage.ts'])).toEqual( | ||
'/some/dir/', | ||
)) | ||
void it('should return the entire parent tree for a single file', () => | ||
assert.equal( | ||
commonParent(['/some/dir/lambda/onMessage.ts']), | ||
'/some/dir/lambda/', | ||
)) | ||
it('should return "/" if files have no common directory', () => | ||
expect( | ||
void it('should return "/" if files have no common directory', () => | ||
assert.equal( | ||
commonParent([ | ||
'/some/dir/lambda/onMessage.ts', | ||
'/other/dir/lambda/onMessage.ts', | ||
]), | ||
).toEqual('/')) | ||
'/', | ||
)) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
module.exports = { extends: ["@commitlint/config-angular"] }; | ||
module.exports = { extends: ["@commitlint/config-conventional"] }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
import { Type } from '@sinclair/typebox' | ||
import { validateWithTypeBox } from './validateWithTypeBox' | ||
import { validateWithTypeBox } from './validateWithTypeBox.js' | ||
import { describe, it } from 'node:test' | ||
import assert from 'node:assert/strict' | ||
|
||
describe('validateWithTypeBox', () => { | ||
it('Should check input is valid', async () => { | ||
void describe('validateWithTypeBox', () => { | ||
void it('Should check input is valid', async () => { | ||
const maybeValid = validateWithTypeBox(Type.Number())(42) | ||
if ('value' in maybeValid) { | ||
expect(maybeValid.value).toEqual(42) | ||
} else { | ||
throw new Error(`It should be valid!`) | ||
} | ||
assert.equal( | ||
'value' in maybeValid && maybeValid.value, | ||
42, | ||
`It should be valid!`, | ||
) | ||
}) | ||
it("Should check as 'invalid' values less than 0", (done) => { | ||
void it("Should check as 'invalid' values less than 0", () => { | ||
const maybeValid = validateWithTypeBox(Type.Number({ minimum: 0 }))(-42) | ||
if ('errors' in maybeValid) { | ||
done() | ||
} else { | ||
throw new Error(`It should not be valid!`) | ||
} | ||
assert.equal('errors' in maybeValid, true, `It should not be valid!`) | ||
}) | ||
}) |
Oops, something went wrong.