Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
flotwig committed Sep 8, 2022
1 parent dc21b48 commit 1fde5a7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 20 deletions.
2 changes: 2 additions & 0 deletions packages/server/test/unit/config_spec.js
Expand Up @@ -5,6 +5,7 @@ const stripAnsi = require('strip-ansi')
const { stripIndent } = require('common-tags')
const Fixtures = require('@tooling/system-tests')
const { getCtx } = require('@packages/data-context')
const { sinon } = require('../spec_helper')

describe('lib/config', () => {
before(function () {
Expand All @@ -25,6 +26,7 @@ describe('lib/config', () => {

this.projectRoot = '/_test-output/path/to/project'

sinon.stub(process, 'chdir').returns()
sinon.stub(this.ctx.lifecycleManager, 'verifyProjectRoot').returns(undefined)

await this.ctx.lifecycleManager.setCurrentProject(this.projectRoot)
Expand Down
10 changes: 8 additions & 2 deletions packages/server/test/unit/util/trash_spec.js
@@ -1,3 +1,5 @@
const mockfs = require('mock-fs')

require('../../spec_helper')

const fs = require('fs')
Expand Down Expand Up @@ -29,10 +31,14 @@ const expectDirectoriesExist = function (basePath) {
}

describe('lib/util/trash', () => {
beforeEach(() => {
mockfs({})
})

context('.folder', () => {
it('trashes contents of directory in non-Linux', () => {
sinon.stub(os, 'platform').returns('darwin')
const basePath = path.join('foo')
const basePath = 'foo'

populateDirectories(basePath)

Expand All @@ -52,7 +58,7 @@ describe('lib/util/trash', () => {

it('completely removes directory on Linux', () => {
sinon.stub(os, 'platform').returns('linux')
const basePath = path.join('foo')
const basePath = 'foo'

populateDirectories(basePath)

Expand Down
18 changes: 0 additions & 18 deletions packages/server/test/unit/util/tty_spec.js
Expand Up @@ -8,17 +8,6 @@ const ttys = [process.stdin.isTTY, process.stdout.isTTY, process.stderr.isTTY]

describe('lib/util/tty', () => {
context('getWindowSize', () => {
// https://github.com/cypress-io/cypress/issues/1815
// windows has undefined process.stdout.getWindowSize
// when running in electron, even when stdio inherited
beforeEach(() => {
// need to delete both the initial module and the
// "base.js" module with problematic tty.getWindowSize call
delete require.cache[require.resolve('mocha-7.0.1/lib/reporters/base')]

return delete require.cache[require.resolve('mocha-7.0.1/lib/reporters')]
})

it('polyfills stdout and stderr getWindowSize', () => {
sinon.stub(tty, 'isatty').returns(true)
sinon.stub(terminalSize, 'get').returns({ columns: 10, rows: 20 })
Expand All @@ -28,15 +17,8 @@ describe('lib/util/tty', () => {

ttyUtil.override()

// forces mocha reporters base to use tty.getWindowSize()
// check the terminal width - should be the ttyUtil hardcoded
require('mocha-7.0.1/lib/reporters')
const base = require('mocha-7.0.1/lib/reporters/base')

expect(process.stdout.getWindowSize()).to.deep.eq([10, 20])
expect(process.stderr.getWindowSize()).to.deep.eq([10, 20])

expect(base.window.width).to.equal(10)
})
})

Expand Down

5 comments on commit 1fde5a7

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 1fde5a7 Sep 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.8.0/linux-x64/webkit-experimental-1fde5a7603dfa1145a738683d02a06c3aeee9326/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 1fde5a7 Sep 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.8.0/linux-arm64/webkit-experimental-1fde5a7603dfa1145a738683d02a06c3aeee9326/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 1fde5a7 Sep 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.8.0/darwin-x64/webkit-experimental-1fde5a7603dfa1145a738683d02a06c3aeee9326/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 1fde5a7 Sep 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.8.0/darwin-arm64/webkit-experimental-1fde5a7603dfa1145a738683d02a06c3aeee9326/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 1fde5a7 Sep 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.8.0/win32-x64/webkit-experimental-1fde5a7603dfa1145a738683d02a06c3aeee9326/cypress.tgz

Please sign in to comment.