Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: specify coffee fixtures / convert others #9433

Merged
merged 1 commit into from
Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from all 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: 7 additions & 7 deletions packages/server/__snapshots__/6_uncaught_support_file_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ exports['e2e uncaught support file errors failing 1'] = `
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Cypress: 1.2.3 │
│ Browser: FooBrowser 88 │
│ Specs: 1 found (spec.coffee)
│ Specs: 1 found (spec.js)
└────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────

Running: spec.coffee (1 of 1)
Running: spec.js (1 of 1)


1) An uncaught error was detected outside of a test
Expand Down Expand Up @@ -47,20 +47,20 @@ We dynamically generated a new test to display this failure.
│ Screenshots: 1 │
│ Video: true │
│ Duration: X seconds │
│ Spec Ran: spec.coffee
│ Spec Ran: spec.js
└────────────────────────────────────────────────────────────────────────────────────────────────┘


(Screenshots)

- /XXX/XXX/XXX/cypress/screenshots/spec.coffee/An uncaught error was detected outs (YxX)
ide of a test (failed).png
- /XXX/XXX/XXX/cypress/screenshots/spec.js/An uncaught error was detected outside (YxX)
of a test (failed).png


(Video)

- Started processing: Compressing to 32 CRF
- Finished processing: /XXX/XXX/XXX/cypress/videos/spec.coffee.mp4 (X second)
- Finished processing: /XXX/XXX/XXX/cypress/videos/spec.js.mp4 (X second)


====================================================================================================
Expand All @@ -70,7 +70,7 @@ We dynamically generated a new test to display this failure.

Spec Tests Passing Failing Pending Skipped
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ ✖ spec.coffee XX:XX 1 - 1 - - │
│ ✖ spec.js XX:XX 1 - 1 - - │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
✖ 1 of 1 failed (100%) XX:XX 1 - 1 - -

Expand Down
4 changes: 2 additions & 2 deletions packages/server/lib/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,9 +519,9 @@ class Project extends EE {
// example:
//
// /Users/bmann/Dev/cypress-app/.projects/cypress/integration
// /Users/bmann/Dev/cypress-app/.projects/cypress/integration/foo.coffee
// /Users/bmann/Dev/cypress-app/.projects/cypress/integration/foo.js
//
// becomes /integration/foo.coffee
// becomes /integration/foo.js

const folderToUse = type === 'integration' ? integrationFolder : componentFolder

Expand Down
6 changes: 3 additions & 3 deletions packages/server/lib/util/specs.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ function findSpecsOfType (searchOptions, specPattern) {
}

// example of resolved paths in the returned spec object
// filePath = /Users/bmann/Dev/my-project/cypress/integration/foo.coffee
// filePath = /Users/bmann/Dev/my-project/cypress/integration/foo.js
// integrationFolderPath = /Users/bmann/Dev/my-project/cypress/integration
// relativePathFromSearchFolder = foo.coffee
// relativePathFromProjectRoot = cypress/integration/foo.coffee
// relativePathFromSearchFolder = foo.js
// relativePathFromProjectRoot = cypress/integration/foo.js

const relativePathFromSearchFolder = (file) => {
return path.relative(searchFolderPath, file)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
it('foo', () => { })
12 changes: 6 additions & 6 deletions packages/server/test/unit/fixture_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,17 +219,17 @@ ParseError: Unterminated string constant\

context('coffee files', () => {
it('returns valid coffee object', function () {
return fixture.get(this.fixturesFolder, 'account.coffee').then((account) => {
expect(account).to.deep.eq({
return fixture.get(this.fixturesFolder, 'valid_coffee_obj.coffee').then((coffeeObj) => {
expect(coffeeObj).to.deep.eq({
name: 'cypress',
users: [],
})
})
})

it('does not rewrite coffee files', function () {
return fixture.get(this.fixturesFolder, 'no_format.coffee').then(() => {
return fs.readFileAsync(`${this.fixturesFolder}/no_format.coffee`, 'utf8').then((str) => {
return fixture.get(this.fixturesFolder, 'no_format_coffee.coffee').then(() => {
return fs.readFileAsync(`${this.fixturesFolder}/no_format_coffee.coffee`, 'utf8').then((str) => {
expect(str).to.eq(`\
[
{id: 1}
Expand Down Expand Up @@ -453,8 +453,8 @@ John,Chef,1982
})

it('does not remove trailing new lines on .coffee', function () {
return fixture.get(this.fixturesFolder, 'trailing_new_line.coffee').then((str) => {
return fs.readFileAsync(`${this.fixturesFolder}/trailing_new_line.coffee`, 'utf8').then((str2) => {
return fixture.get(this.fixturesFolder, 'trailing_new_line_coffee.coffee').then((str) => {
return fs.readFileAsync(`${this.fixturesFolder}/trailing_new_line_coffee.coffee`, 'utf8').then((str2) => {
expect(str2).to.eq('{ foo: "bar" }\n')
})
})
Expand Down
4 changes: 2 additions & 2 deletions packages/server/test/unit/socket_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -702,8 +702,8 @@ describe('lib/socket', () => {
})

it('calls statAsync on .coffee file', function () {
return this.socket.onTestFileChange('foo/bar.coffee').then(() => {
expect(fs.statAsync).to.be.calledWith('foo/bar.coffee')
return this.socket.onTestFileChange('foo/bar_coffee.coffee').then(() => {
expect(fs.statAsync).to.be.calledWith('foo/bar_coffee.coffee')
})
})

Expand Down