test: clean tests, add coverage + verbose

This commit is contained in:
Chen Asraf
2023-05-01 23:42:41 +03:00
committed by Chen Asraf
parent 32eefc26bb
commit 1545665fce
3 changed files with 8 additions and 7 deletions

View File

@@ -89,7 +89,7 @@ describe('Groups', () => {
})
describe('Logical operator OR', () => {
test('should parse OR separator', () => {
test('Should parse OR separator', () => {
const reader = new StringReader('word OR word')
const lexer = new Lexer(reader)
const tokens = lexer.parse()
@@ -110,7 +110,7 @@ describe('Logical operator OR', () => {
expect(tokens[4].value).toBe('word')
})
test('should not parse OR separator mid-word', () => {
test('Should not parse OR separator mid-word', () => {
const reader = new StringReader('wordORword')
const lexer = new Lexer(reader)
const tokens = lexer.parse()
@@ -119,7 +119,7 @@ describe('Logical operator OR', () => {
expect(tokens[0].value).toBe('wordORword')
})
test('should parse | separator', () => {
test('Should parse | separator', () => {
const reader = new StringReader('word | word')
const lexer = new Lexer(reader)
const tokens = lexer.parse()
@@ -142,7 +142,7 @@ describe('Logical operator OR', () => {
})
describe('Logical operator AND', () => {
test('should parse AND separator', () => {
test('Should parse AND separator', () => {
const reader = new StringReader('word AND word')
const lexer = new Lexer(reader)
const tokens = lexer.parse()
@@ -163,7 +163,7 @@ describe('Logical operator AND', () => {
expect(tokens[4].value).toBe('word')
})
test('should not parse AND separator mid-word', () => {
test('Should not parse AND separator mid-word', () => {
const reader = new StringReader('wordANDword')
const lexer = new Lexer(reader)
const tokens = lexer.parse()
@@ -172,7 +172,7 @@ describe('Logical operator AND', () => {
expect(tokens[0].value).toBe('wordANDword')
})
test('should parse & separator', () => {
test('Should parse & separator', () => {
const reader = new StringReader('word & word')
const lexer = new Lexer(reader)
const tokens = lexer.parse()

View File

@@ -57,7 +57,6 @@ test('should parse multiple groups and logical operators', () => {
const lexer = new Lexer(reader)
const parser = new Parser(lexer)
const tokens = parser.parse()
console.log('tokens', JSON.stringify(tokens, undefined, 2))
expect(tokens[0]).toEqual({
type: 'operator',
value: 'and',

View File

@@ -1,7 +1,9 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
verbose: true,
preset: 'ts-jest',
testEnvironment: 'node',
collectCoverage: true,
testMatch: [
'**/tests/**/*.[jt]s?(x)',
'**/__tests__/**/*.[jt]s?(x)',