Skip to content

Commit

Permalink
Add test to lint
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Jan 22, 2024
1 parent b418271 commit ed773f2
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 13 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: './tsconfig.json',
project: './tsconfig.lint.json',
},
rules: {
'@typescript-eslint/no-unused-vars': [
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"scripts": {
"test": "jest",
"coverage": "npm test -- --coverage",
"lint": "eslint --ext .js,.ts src",
"lint": "eslint --ext .js,.ts src test",
"clean": "rimraf dist esm",
"prebuild": "npm run clean && npm run lint",
"build:esm": "tsc --target es2018 --outDir esm",
Expand Down Expand Up @@ -58,7 +58,7 @@
"eslint-plugin-unicorn": "^49.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.5.0",
"prettier": "^3.1.1",
"prettier": "^3.2.4",
"rimraf": "^5.0.1",
"standard-changelog": "^5.0.0",
"ts-jest": "^29.1.1",
Expand Down
10 changes: 5 additions & 5 deletions test/tabixindexedfile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ test('can read ctgA:1000..4000', async () => {

const headerString = await f.getHeader()
expect(headerString.length).toEqual(10431)
expect(headerString[headerString.length - 1]).toEqual('\n')
expect(headerString.at(-1)).toEqual('\n')

expect(await f.getMetadata()).toEqual({
columnNumbers: { end: 0, ref: 1, start: 2 },
Expand Down Expand Up @@ -140,7 +140,7 @@ test('can query volvox.sort.gff3.gz.1', async () => {
})

const headerString = await f.getHeader()
expect(headerString[headerString.length - 1]).toEqual('\n')
expect(headerString.at(-1)).toEqual('\n')
expect(headerString.length).toEqual(130)

const lines = new RecordCollector()
Expand Down Expand Up @@ -173,7 +173,7 @@ test('can query gvcf.vcf.gz', async () => {

const headerString = await f.getHeader()
expect(headerString.length).toEqual(53)
expect(headerString[headerString.length - 1]).toEqual('\n')
expect(headerString.at(-1)).toEqual('\n')

const lines = [] as string[]
await f.getLines('ctgB', 0, Infinity, l => lines.push(l))
Expand Down Expand Up @@ -238,7 +238,7 @@ test('can query test.vcf.gz with a CSI index', async () => {

const headerString = await f.getHeader()
expect(headerString.length).toEqual(2560)
expect(headerString[headerString.length - 1]).toEqual('\n')
expect(headerString.at(-1)).toEqual('\n')

const lines = new RecordCollector()
await f.getLines('ctgB', 0, Infinity, lines.callback)
Expand Down Expand Up @@ -285,7 +285,7 @@ test('can fetch the entire header for a very large vcf header', async () => {
const h = await f.getHeader()
const lastBit = 'CN_105715_AGL\tCDC_QG-1_AGL\tCDC_SB-1_AGL\n'
expect(h.slice(h.length - lastBit.length, h.length)).toEqual(lastBit)
expect(h[h.length - 1]).toEqual('\n')
expect(h.at(-1)).toEqual('\n')
expect(h.length).toEqual(5315655)
})

Expand Down
4 changes: 4 additions & 0 deletions tsconfig.lint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig",
"include": ["src", "test"]
}
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3716,10 +3716,10 @@ prettier-linter-helpers@^1.0.0:
dependencies:
fast-diff "^1.1.2"

prettier@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.1.1.tgz#6ba9f23165d690b6cbdaa88cb0807278f7019848"
integrity sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==
prettier@^3.2.4:
version "3.2.4"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.4.tgz#4723cadeac2ce7c9227de758e5ff9b14e075f283"
integrity sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ==

pretty-format@^29.0.0, pretty-format@^29.7.0:
version "29.7.0"
Expand Down

0 comments on commit ed773f2

Please sign in to comment.