Skip to content

Commit

Permalink
chore: refactor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tale committed Feb 22, 2022
1 parent c077d5f commit 9e24787
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/control.test.ts → test/control.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { readFile } from 'node:fs/promises'
import { BinaryControl } from '.'
import { BinaryControl } from '../src'

test('control:clang', async () => {
const data = await readFile('test/clang.control', 'utf8')
const data = await readFile('test/files/clang.control', 'utf8')
const control = new BinaryControl(data)

expect(control.package).toEqual('clang')
Expand Down Expand Up @@ -39,7 +39,7 @@ test('control:clang', async () => {
})

test('control:com.amywhile.signalreborn', async () => {
const data = await readFile('test/com.amywhile.signalreborn.control', 'utf8')
const data = await readFile('test/files/com.amywhile.signalreborn.control', 'utf8')
const control = new BinaryControl(data)

expect(control.package).toEqual('com.amywhile.signalreborn')
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions src/index.test.ts → test/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import { readFile } from 'node:fs/promises'
import { parsePackages, parseRelease } from '.'
import { parsePackages, parseRelease } from '../src'

test('deprecated:release:chariz', async () => {
const data = await readFile('test/chariz.release', 'utf8')
const data = await readFile('test/files/chariz.release', 'utf8')
const map = parseRelease(data)
expect(map).toBeDefined()
})

test('deprecated:release:jammy', async () => {
const data = await readFile('test/jammy.release', 'utf8')
const data = await readFile('test/files/jammy.release', 'utf8')
const map = parseRelease(data)
expect(map).toBeDefined()
})

test('deprecated:packages:chariz', async () => {
const data = await readFile('test/chariz.packages', 'utf8')
const data = await readFile('test/files/chariz.packages', 'utf8')
const map = parsePackages(data)
expect(map.length).toBe(415)
})

test('deprecated:packages:jammy', async () => {
const data = await readFile('test/jammy.packages', 'utf8')
const data = await readFile('test/files/jammy.packages', 'utf8')
const map = parsePackages(data)
expect(map.length).toBe(6132)
})
6 changes: 3 additions & 3 deletions src/packages.test.ts → test/packages.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { readFile } from 'node:fs/promises'
import { Packages } from '.'
import { Packages } from '../src'

test('chariz:packages', async () => {
const data = await readFile('test/chariz.packages', 'utf8')
const data = await readFile('test/files/chariz.packages', 'utf8')
const packages = new Packages(data)
const pkg = packages[0]

Expand Down Expand Up @@ -32,7 +32,7 @@ test('chariz:packages', async () => {
})

test('jammy:packages', async () => {
const data = await readFile('test/jammy.packages', 'utf8')
const data = await readFile('test/files/jammy.packages', 'utf8')
const packages = new Packages(data)
const pkg = packages[0]

Expand Down
6 changes: 3 additions & 3 deletions src/release.test.ts → test/release.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { readFile } from 'node:fs/promises'
import { Release } from '.'
import { Release } from '../src'

test('release:chariz', async () => {
const data = await readFile('test/chariz.release', 'utf8')
const data = await readFile('test/files/chariz.release', 'utf8')
const release = new Release(data)

expect(release.fieldCount).toEqual(11)
Expand Down Expand Up @@ -32,7 +32,7 @@ test('release:chariz', async () => {
})

test('release:jammy', async () => {
const data = await readFile('test/jammy.release', 'utf8')
const data = await readFile('test/files/jammy.release', 'utf8')
const release = new Release(data)

expect(release.fieldCount).toEqual(13)
Expand Down

0 comments on commit 9e24787

Please sign in to comment.