Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,35 @@ https://sofie-automation.github.io/sofie-core//docs/for-developers/contribution-
-->

## About the Contributor

<!--
Tell us who / which organization you are representing, and how the Sofie team will be able to contact you.
Example: "This pull request is posted on behalf of the NRK."
-->


## Type of Contribution

This is a:

<!-- (pick one) -->
Bug fix / Feature / Code improvement / Documentation improvement / Other (please specify)

Bug fix / Feature / Code improvement / Documentation improvement / Other (please specify)

## Current Behavior

<!--
Please describe how things worked before this PR.
If it's a bug fixe: Describe the bug (what was happening?)
-->


## New Behavior

<!--
What is the new behavior?
-->


## Testing Instructions

<!--
Please provide some instructions and other information for how to verify that the feature works.
Examples:
Expand All @@ -39,12 +41,12 @@ Examples:
* "This feature also affects 'feature X', so that needs to be tested for regressions as well."
-->


## Other Information
<!-- The more information you can provide, the easier the pull request will be to merge -->

<!-- The more information you can provide, the easier the pull request will be to merge -->

## Status

<!--
Before you open the PR, make sure the items below are done.
If they're not, please open the PR as a Draft.
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

Before contributing to this specific repository, please read the [Contribution Guidelines](https://sofie-automation.github.io/sofie-core//docs/for-developers/contribution-guidelines) for the _Sofie_ project.


## Branches

This repository uses the following branches:

* **_main_** is our main branch. We consider it stable and it is used in production.
- **_main_** is our main branch. We consider it stable and it is used in production.

We encourage you to base your contributions on the latest **_main_** branch of this repository. The [_Sofie Releases_](https://sofie-automation.github.io/sofie-core//releases) page collects the status and timeline of the _Sofie_ releases.
16 changes: 8 additions & 8 deletions src/__tests__/atem.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('Atem', () => {
const conn = new Atem({ disableMultithreaded: true })

try {
const socket = (conn as any).socket as AtemSocket
const socket = (conn as any).client.socket as AtemSocket
expect(socket).toBeTruthy()

expect(AtemSocket).toHaveBeenCalledTimes(1)
Expand All @@ -45,7 +45,7 @@ describe('Atem', () => {
const conn = new Atem({ debugBuffers: true, address: 'test1', port: 23, maxPacketSize: 500 })

try {
const socket = (conn as any).socket as AtemSocket
const socket = (conn as any).client.socket as AtemSocket
expect(socket).toBeTruthy()

expect(AtemSocket).toHaveBeenCalledTimes(1)
Expand All @@ -67,7 +67,7 @@ describe('Atem', () => {
const conn = new Atem({ debugBuffers: true, address: 'test1', port: 23 })

try {
const socket = (conn as any).socket as AtemSocket
const socket = (conn as any).client.socket as AtemSocket
expect(socket).toBeTruthy()

socket.connect = jest.fn(() => Promise.resolve(5) as any)
Expand All @@ -86,7 +86,7 @@ describe('Atem', () => {
const conn = new Atem({ debugBuffers: true, address: 'test1', port: 23 })

try {
const socket = (conn as any).socket as AtemSocket
const socket = (conn as any).client.socket as AtemSocket
expect(socket).toBeTruthy()

socket.disconnect = jest.fn(() => Promise.resolve(35) as any)
Expand All @@ -106,7 +106,7 @@ describe('Atem', () => {
const conn = new Atem({ debugBuffers: true, address: 'test1', port: 23 })

try {
const socket = (conn as any).socket as AtemSocket
const socket = (conn as any).client.socket as AtemSocket
expect(socket).toBeTruthy()

let nextId = 123
Expand All @@ -118,7 +118,7 @@ describe('Atem', () => {

socket.sendCommands = jest.fn(() => Promise.resolve([124]) as any)

const sentQueue = (conn as any)._sentQueue as Record<string, unknown>
const sentQueue = (conn as any).client._sentQueue as Record<string, unknown>
expect(Object.keys(sentQueue)).toHaveLength(0)

const cmd = new CutCommand(0)
Expand Down Expand Up @@ -146,7 +146,7 @@ describe('Atem', () => {
const conn = new Atem({ debugBuffers: true, address: 'test1', port: 23 })

try {
const socket = (conn as any).socket as AtemSocket
const socket = (conn as any).client.socket as AtemSocket
expect(socket).toBeTruthy()

let nextId = 123
Expand All @@ -158,7 +158,7 @@ describe('Atem', () => {

socket.sendCommands = jest.fn(() => Promise.reject(35) as any)

const sentQueue = (conn as any)._sentQueue as Record<string, unknown>
const sentQueue = (conn as any).client._sentQueue as Record<string, unknown>
expect(Object.keys(sentQueue)).toHaveLength(0)

const cmd = new CutCommand(0)
Expand Down
6 changes: 3 additions & 3 deletions src/__tests__/connection.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function createConnection(): BasicAtem {
}

function getChild(conn: BasicAtem): ThreadedClass<AtemSocketChildMock> {
return (conn as any).socket._socketProcess
return (conn as any).client.socket._socketProcess
}

function expectIsValidEnumValue<T>(enumObj: Record<string, T>, value: T): void {
Expand Down Expand Up @@ -102,8 +102,8 @@ function runTest(name: string, filename: string): void {

describe('Paths', () => {
const conn = createConnection()
const parser: (b: Buffer) => IDeserializedCommand[] = (conn as any).socket._parseCommands.bind(
(conn as any).socket
const parser: (b: Buffer) => IDeserializedCommand[] = (conn as any).client.socket._parseCommands.bind(
(conn as any).client.socket
)

const commands: IDeserializedCommand[] = []
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function createConnection(apiVersion: Enums.ProtocolVersion): Atem {

// conn.on('error', () => null)
conn.sendCommand = jest.fn()
;(conn as any)._state = state
;(conn as any).client._state = state

return conn
}
Expand Down
Loading