mirror of
https://github.com/streamwall/streamwall.git
synced 2025-12-06 01:45:37 -05:00
Clean up redundant tests, rename scripts
This commit is contained in:
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -26,7 +26,7 @@ jobs:
|
|||||||
run: npm install
|
run: npm install
|
||||||
|
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: npm test
|
run: npm run test:ci
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
"start": "npm run build -- --stats=errors-only && electron dist",
|
"start": "npm run build -- --stats=errors-only && electron dist",
|
||||||
"start-local": "npm run build -- --stats=errors-only && electron dist --control.address=http://localhost:4444 --control.username=streamwall --control.password=local-dev",
|
"start-local": "npm run build -- --stats=errors-only && electron dist --control.address=http://localhost:4444 --control.username=streamwall --control.password=local-dev",
|
||||||
"start-dev": "npm run build -- --stats=verbose && electron dist --enable-logging --control.address=http://localhost:4444 --control.username=streamwall --control.password=local-dev",
|
"start-dev": "npm run build -- --stats=verbose && electron dist --enable-logging --control.address=http://localhost:4444 --control.username=streamwall --control.password=local-dev",
|
||||||
"test-full": "jest",
|
"jest": "jest",
|
||||||
"test": "jest --ci --reporters=default --reporters=jest-junit --testPathIgnorePatterns=src/node/server.test.js --coverage"
|
"test:ci": "jest --ci --reporters=default --reporters=jest-junit --testPathIgnorePatterns=src/node/server.test.js --coverage"
|
||||||
},
|
},
|
||||||
"author": "Max Goodhart <c@chromakode.com>",
|
"author": "Max Goodhart <c@chromakode.com>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -90,40 +90,42 @@ describe.each([
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('idxToCoords', () => {
|
describe.each([
|
||||||
it('should convert index to coordinates correctly', () => {
|
[
|
||||||
const gridCount = 5
|
'a middle index',
|
||||||
const idx = 12
|
5,
|
||||||
const result = idxToCoords(gridCount, idx)
|
12,
|
||||||
expect(result).toEqual({ x: 2, y: 2 })
|
{ x: 2, y: 2 },
|
||||||
})
|
],
|
||||||
|
[
|
||||||
|
'the top-left corner',
|
||||||
|
5,
|
||||||
|
0,
|
||||||
|
{ x: 0, y: 0 },
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'the top-right corner',
|
||||||
|
5,
|
||||||
|
4,
|
||||||
|
{ x: 4, y: 0 },
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'the bottom-left corner',
|
||||||
|
5,
|
||||||
|
20,
|
||||||
|
{ x: 0, y: 4 },
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'the bottom-right corner',
|
||||||
|
5,
|
||||||
|
24,
|
||||||
|
{ x: 4, y: 4 },
|
||||||
|
],
|
||||||
|
|
||||||
it('should support the top-left corner', () => {
|
])('idxToCoords', (humanized_location, gridCount, idx, coords) => {
|
||||||
const gridCount = 5
|
test(`should support ${humanized_location}`, () => {
|
||||||
const idx = 0
|
|
||||||
const result = idxToCoords(gridCount, idx)
|
const result = idxToCoords(gridCount, idx)
|
||||||
expect(result).toEqual({ x: 0, y: 0 })
|
expect(result).toEqual(coords)
|
||||||
})
|
|
||||||
|
|
||||||
it('should support the top-right corner', () => {
|
|
||||||
const gridCount = 5
|
|
||||||
const idx = 4
|
|
||||||
const result = idxToCoords(gridCount, idx)
|
|
||||||
expect(result).toEqual({ x: 4, y: 0 })
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should support the bottom-left corner', () => {
|
|
||||||
const gridCount = 5
|
|
||||||
const idx = 20
|
|
||||||
const result = idxToCoords(gridCount, idx)
|
|
||||||
expect(result).toEqual({ x: 0, y: 4 })
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should support the bottom-right corner', () => {
|
|
||||||
const gridCount = 5
|
|
||||||
const idx = 24
|
|
||||||
const result = idxToCoords(gridCount, idx)
|
|
||||||
expect(result).toEqual({ x: 4, y: 4 })
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user