mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-13 02:40:22 -05:00
Investigate spec on mac (#7111)
* run scripts unit tests on Mac too * build this branch on Mac on CircleCI * skip some mock file system tests, run them only on Linux * skip dynamically * use function expression
This commit is contained in:
+23
-2
@@ -8,7 +8,7 @@ macBuildFilters: &macBuildFilters
|
||||
branches:
|
||||
only:
|
||||
- develop
|
||||
- try-new-electron-sign
|
||||
- investigate-spec-on-mac
|
||||
|
||||
defaults: &defaults
|
||||
parallelism: 1
|
||||
@@ -325,6 +325,17 @@ jobs:
|
||||
command: yarn type-check --ignore-progress
|
||||
- store-npm-logs
|
||||
|
||||
build-system-unit-tests:
|
||||
<<: *defaults
|
||||
parallelism: 1
|
||||
steps:
|
||||
- attach_workspace:
|
||||
at: ~/
|
||||
# make sure mocha runs
|
||||
- run: yarn test-mocha
|
||||
# test binary build code
|
||||
- run: yarn test-scripts
|
||||
|
||||
"server-unit-tests":
|
||||
<<: *defaults
|
||||
parallelism: 2
|
||||
@@ -1166,6 +1177,9 @@ linux-workflow: &linux-workflow
|
||||
- cli-visual-tests:
|
||||
requires:
|
||||
- build
|
||||
- build-system-unit-tests:
|
||||
requires:
|
||||
- build
|
||||
- unit-tests:
|
||||
requires:
|
||||
- build
|
||||
@@ -1403,7 +1417,14 @@ mac-workflow: &mac-workflow
|
||||
requires:
|
||||
- Mac build
|
||||
|
||||
# maybe run unit tests?
|
||||
- build-system-unit-tests:
|
||||
name: Mac build system unit tests
|
||||
executor: mac
|
||||
requires:
|
||||
- Mac build
|
||||
<<: *macBuildFilters
|
||||
|
||||
# maybe run all unit tests?
|
||||
|
||||
- build-npm-package:
|
||||
name: Mac NPM package
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* global sinon */
|
||||
const os = require('os')
|
||||
const _ = require('lodash')
|
||||
const path = require('path')
|
||||
@@ -5,6 +6,7 @@ const proxyquire = require('proxyquire')
|
||||
const mockfs = require('mock-fs')
|
||||
const _snapshot = require('snap-shot-it')
|
||||
const chai = require('chai')
|
||||
const debug = require('debug')('test')
|
||||
|
||||
chai.use(require('chai-as-promised'))
|
||||
|
||||
@@ -26,6 +28,8 @@ const snapshot = (...args) => {
|
||||
|
||||
describe('packages', () => {
|
||||
it('can copy files from package.json', async () => {
|
||||
sinon.stub(os, 'tmpdir').returns('/tmp')
|
||||
|
||||
mockfs({
|
||||
'packages': {
|
||||
'coffee': {
|
||||
@@ -77,7 +81,12 @@ describe('packages', () => {
|
||||
})
|
||||
|
||||
describe('transformRequires', () => {
|
||||
it('can find and replace symlink requires', async () => {
|
||||
it('can find and replace symlink requires', async function () {
|
||||
// these tests really refuse to work on Mac, so for now run it only on Linux
|
||||
if (os.platform() !== 'linux') {
|
||||
return this.skip()
|
||||
}
|
||||
|
||||
const buildRoot = 'build/linux/Cypress/resources/app'
|
||||
|
||||
mockfs({
|
||||
@@ -101,12 +110,22 @@ describe('transformRequires', () => {
|
||||
// should return number of transformed requires
|
||||
await expect(transformRequires(buildRoot)).to.eventually.eq(2)
|
||||
|
||||
// console.log(getFs())
|
||||
const files = getFs()
|
||||
|
||||
snapshot(getFs())
|
||||
if (debug.enabled) {
|
||||
debug('returned file system')
|
||||
/* eslint-disable-next-line no-console */
|
||||
console.error(files)
|
||||
}
|
||||
|
||||
snapshot(files)
|
||||
})
|
||||
|
||||
it('can find and replace symlink requires on win32', async () => {
|
||||
it('can find and replace symlink requires on win32', async function () {
|
||||
if (os.platform() !== 'linux') {
|
||||
return this.skip()
|
||||
}
|
||||
|
||||
const { transformRequires } = proxyquire('../../../binary/util/transform-requires', { path: path.win32 })
|
||||
const buildRoot = 'build/linux/Cypress/resources/app'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user