Skip to content

Commit

Permalink
Integration test on features.no
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanjermakov committed Jun 11, 2023
1 parent 657a38d commit 807c37f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
24 changes: 21 additions & 3 deletions src/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
describe('test', () => {
it('should run test', () => {
expect(2 + 2).toEqual(4)
import { tokenize } from './lexer/lexer'
import { readFileSync } from 'fs'
import { Parser } from './parser/parser'
import { parseModule } from './parser/parser-fns'

describe('nois', () => {
it('parse features', () => {
const filename = 'features.no'
const source = { str: readFileSync(`data/${filename}`).toString(), filename }
const tokens = tokenize(source.str)

expect(tokens.filter(t => t.kind === 'unknown').length).toEqual(0)

const parser = new Parser(tokens)
parseModule(parser)

expect(parser.errors.length).toEqual(0)

const root = parser.buildTree()

expect(root.kind).toEqual('module')
})
})
1 change: 0 additions & 1 deletion src/parser/parser.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { compactNode, Parser } from './parser'
import { tokenize } from '../lexer/lexer'
import { expect } from '@jest/globals'
import { parseModule } from './parser-fns'

describe('parser', () => {
Expand Down

0 comments on commit 807c37f

Please sign in to comment.