Skip to content

Commit

Permalink
refactor: Spellcheck (cypress-io#27964)
Browse files Browse the repository at this point in the history
Co-authored-by: Matthew Schile <mschile@cypress.io>
  • Loading branch information
calvinballing and mschile authored Oct 11, 2023
1 parent 078dc0a commit 34c8b1f
Show file tree
Hide file tree
Showing 104 changed files with 170 additions and 170 deletions.
2 changes: 1 addition & 1 deletion cli/lib/exec/spawn.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ module.exports = {
return
}

// if we have a callback and this explictly returns
// if we have a callback and this explicitly returns
// false then bail
if (onStderrData && onStderrData(str) === false) {
return
Expand Down
2 changes: 1 addition & 1 deletion cli/lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ const util = {
},

supportsColor () {
// if we've been explictly told not to support
// if we've been explicitly told not to support
// color then turn this off
if (process.env.NO_COLOR) {
return false
Expand Down
4 changes: 2 additions & 2 deletions cli/test/lib/cli_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ describe('cli', () => {
expect(spawn.start.firstCall.args[0]).to.include('component')
})

it('spawns server with correct args for depricated component-testing command', () => {
it('spawns server with correct args for deprecated component-testing command', () => {
this.exec('open-ct --dev')
expect(spawn.start.firstCall.args[0]).to.include('--testing-type')
expect(spawn.start.firstCall.args[0]).to.include('component')
Expand All @@ -647,7 +647,7 @@ describe('cli', () => {
expect(spawn.start.firstCall.args[0]).to.include('component')
})

it('runs server with correct args for depricated component-testing command', () => {
it('runs server with correct args for deprecated component-testing command', () => {
this.exec('run-ct --dev')
expect(spawn.start.firstCall.args[0]).to.include('--testing-type')
expect(spawn.start.firstCall.args[0]).to.include('component')
Expand Down
2 changes: 1 addition & 1 deletion cli/test/lib/exec/spawn_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ describe('lib/exec/spawn', function () {
})
})

it('inherits when on linux and xvfb isnt needed', function () {
it('inherits when on linux and xvfb isn\'t needed', function () {
this.spawnedProcess.on.withArgs('close').yieldsAsync(0)
os.platform.returns('linux')
xvfb.isNeeded.returns(false)
Expand Down
4 changes: 2 additions & 2 deletions cli/types/cypress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3318,7 +3318,7 @@ declare namespace Cypress {

interface CypressComponentDependency {
/**
* Unique idenitifer.
* Unique identifier.
* @example 'reactscripts'
*/
type: string
Expand Down Expand Up @@ -3453,7 +3453,7 @@ declare namespace Cypress {
componentIndexHtml?: () => string

/**
* Used for the Create From Comopnent feature.
* Used for the Create From Component feature.
* This is currently not supported for third party frameworks.
*/
specPattern?: '**/*.cy.ts'
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
# Use Hist file from shared volume
HISTFILE: /root/hist/.bash_history
# Setup inspect to use the more permissive address when debugging so
# that we can connect to it from ouside the docker container
# that we can connect to it from outside the docker container
CYPRESS_DOCKER_DEV_INSPECT_OVERRIDE: '0.0.0.0:5566'
# This disables CI mode which causes cypress to build differently
CI: ''
Expand Down
2 changes: 1 addition & 1 deletion guides/writing-cross-platform-javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ path.resolve('../', '/../', '../')
// 'C:\\Users' on Windows
```

In general, you want to avoid writing file system code using `/` and `\`, and use Node.js APIs where possible - those are cross platform and guarenteed to work.
In general, you want to avoid writing file system code using `/` and `\`, and use Node.js APIs where possible - those are cross platform and guaranteed to work.

## Use Node.js Scripts

Expand Down
10 changes: 5 additions & 5 deletions npm/create-cypress-tests/scripts/copy-templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ program
unique: true,
})

const srcOuput = './src/'
let destinationOuput = destination.replace('/\\/g', '/')
const srcOutput = './src/'
let destinationOutput = destination.replace('/\\/g', '/')

if (!destinationOuput.endsWith('/')) {
destinationOuput += '/'
if (!destinationOutput.endsWith('/')) {
destinationOutput += '/'
}

const relOutput = (template, forSource) => {
return `${forSource ? srcOuput : destinationOuput}${template}`
return `${forSource ? srcOutput : destinationOutput}${template}`
}

const result = await Promise.all(templates.map(async (template) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('lib/util/config-file-updater', () => {
context('with js files', () => {
describe('#insertValueInJSString', () => {
describe('es6 vs es5', () => {
it('finds the object litteral and adds the values to it es6', async () => {
it('finds the object literal and adds the values to it es6', async () => {
const src = stripIndent`\
export default {
foo: 42,
Expand All @@ -63,7 +63,7 @@ describe('lib/util/config-file-updater', () => {
expect(output).to.equal(expectedOutput)
})

it('finds the object litteral and adds the values to it es5', async () => {
it('finds the object literal and adds the values to it es5', async () => {
const src = stripIndent`\
module.exports = {
foo: 42,
Expand Down Expand Up @@ -333,7 +333,7 @@ describe('lib/util/config-file-updater', () => {
})

describe('failures', () => {
it('fails if not an object litteral', () => {
it('fails if not an object literal', () => {
const src = [
'const foo = {}',
'export default foo',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export async function insertValueInJSString (fileContents: string, obj: Record<s
const splicers: Splicer[] = []

if (!objectLiteralNode) {
// if the export is no object litteral
// if the export is no object literal
throw new Error('Cypress was unable to add/update values in your configuration file.')
}

Expand Down
4 changes: 2 additions & 2 deletions npm/create-cypress-tests/src/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ describe('create-cypress-tests', () => {
expect(someOfSpyCallsIncludes(logSpy, 'yarn cypress open')).to.be.true
})

it('Fails if git repository have untracked or uncommited files', async () => {
it('Fails if git repository have untracked or uncommitted files', async () => {
mockFsWithInitialTemplate({
'/package.json': JSON.stringify({ }),
})
Expand All @@ -121,7 +121,7 @@ describe('create-cypress-tests', () => {
await main({ useNpm: true, ignoreTs: false, ignoreExamples: false, setupComponentTesting: false })

expect(
someOfSpyCallsIncludes(errorSpy, 'This repository has untracked files or uncommmited changes.'),
someOfSpyCallsIncludes(errorSpy, 'This repository has untracked files or uncommitted changes.'),
).to.equal(true)

expect(processExitStub).to.be.called
Expand Down
2 changes: 1 addition & 1 deletion npm/create-cypress-tests/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export async function main ({ useNpm, ignoreTs, setupComponentTesting, ignoreExa
const gitStatus = await getGitStatus()

if (gitStatus) {
console.error(`\n${chalk.bold.red('This repository has untracked files or uncommmited changes.')}\nThis command will ${chalk.cyan('make changes in the codebase')}, so please remove untracked files, stash or commit any changes, and try again.`)
console.error(`\n${chalk.bold.red('This repository has untracked files or uncommitted changes.')}\nThis command will ${chalk.cyan('make changes in the codebase')}, so please remove untracked files, stash or commit any changes, and try again.`)
process.exit(1)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('Users with Fetch', () => {
.contains('foo')
})

it('can inspect mocked network reaponse', () => {
it('can inspect mocked network response', () => {
const users = [{ id: 1, name: 'foo' }]

cy.intercept('GET', '/users?_limit=3', users).as('users')
Expand Down
2 changes: 1 addition & 1 deletion npm/vite-dev-server/src/plugins/cypress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const Cypress = (
base = config.base
},
async transformIndexHtml (html) {
// it's possibe other plugins have modified the HTML
// it's possible other plugins have modified the HTML
// before we get to. For example vitejs/plugin-react will
// add a preamble. We do our best to look at the HTML we
// receive and inject it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('Message', () => {
describe('Events', () => {
it('calls handleClick when click on message', () => {
// need to spy on the _original_ method before it gets
// passed to the Vue.extend and gets into private closuer
// passed to the Vue.extend and gets into private closure
const spy = cy.spy(Message.methods, 'handleClick')

createCmp({ message: 'Cat' })
Expand Down
6 changes: 3 additions & 3 deletions npm/vue/cypress/component/router-example/PizzaShop/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
🍖 Meatlover
</router-link><br>
<router-link
:to="{ name: 'order', params: { preset: 'hawaian' } }"
class="order-hawaian"
:to="{ name: 'order', params: { preset: 'hawaiian' } }"
class="order-hawaiian"
>
🍍 Hawain
🍍 Hawaiian
</router-link><br>
<router-link
:to="{ name: 'order', query: { cheese: true } }"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const BACON = { name: 'bacon', icon: '🥓' }
const veggie = [CHEESE, TOMATOES, MUSHROOMS, PEPPERS, PINEAPPLE]
const vegan = [TOMATOES, MUSHROOMS, PEPPERS, PINEAPPLE]
const meatlover = [CHEESE, CHICKEN, STEAK, HAM, BACON]
const hawaian = [CHEESE, PINEAPPLE, HAM]
const hawaiian = [CHEESE, PINEAPPLE, HAM]

export const ALL_TOPPINGS = [
CHEESE,
Expand All @@ -25,4 +25,4 @@ export const ALL_TOPPINGS = [
BACON,
]

export const PRESETS = { veggie, vegan, meatlover, hawaian }
export const PRESETS = { veggie, vegan, meatlover, hawaiian }
4 changes: 2 additions & 2 deletions npm/vue/cypress/component/router-example/router.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ describe('Vue Router - Pizza Shop', () => {
cy.get('.order-overview > ul > li').contains('cheese')
})

it('order hawaian + peppers pizza without using UI', () => {
it('order hawaiian + peppers pizza without using UI', () => {
cy.wrap(Cypress.vue.$router)
.then(($router) => $router.push({ name: 'home' }))
.then(($router) => {
return $router.push({
name: 'order',
params: { preset: 'hawaian' },
params: { preset: 'hawaiian' },
query: { peppers: true },
})
})
Expand Down
2 changes: 1 addition & 1 deletion npm/vue/cypress/component/tailwind/redbox.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('RedBox 1', () => {

it('displays red Hello RedBox', () => {
mount({ template }, options)
// shoud have injected the inline styling.
// should have injected the inline styling.
cy.get('style').should('contain.text', inlineStyle)

cy.contains('Hello RedBox')
Expand Down
2 changes: 1 addition & 1 deletion npm/vue2/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ function failTestOnVueError (err, vm, info) {

/**
* Extract the component name from the object passed to mount
* @param componentOptions the compoennt passed to mount
* @param componentOptions the component passed to mount
* @returns name of the component
*/
function getComponentDisplayName (componentOptions: any): string {
Expand Down
2 changes: 1 addition & 1 deletion npm/webpack-preprocessor/test/unit/dist.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { expect } = require('chai')
const preprocessor = require('../../dist/index')

describe('tyepscript ./dist output', () => {
describe('typescript ./dist output', () => {
it('builds dist correctly', () => {
expect(preprocessor).to.be.a('function')
expect(preprocessor).to.have.property('defaultOptions')
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/debug/DebugSpec.cy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ describe('<DebugSpec/> responsive UI', () => {
},
}

const testResult: {[thumprint: string]: TestResults[]} = {
const testResult: {[thumbprint: string]: TestResults[]} = {
'abcd': [
{
id: '676df87878',
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/runner/iframe-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface AutSnapshot {
viewportWidth: number
url: string
body: {
get: () => unknown // TOOD: find out what this is, some sort of JQuery API.
get: () => unknown // TODO: find out what this is, some sort of JQuery API.
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/runner/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ export function getRunnerConfigFromWindow () {
/**
* Inject the global `UnifiedRunner` via a <script src="..."> tag.
* which includes the event manager and AutIframe constructor.
* It is bundlded via webpack and consumed like a third party module.
* It is bundled via webpack and consumed like a third party module.
*
* This only needs to happen once, prior to running the first spec.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/runs/RunsConnectSuccessAlert.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('<RunConnectSuccessAlert />', { viewportHeight: 400 }, () => {
})

// https://github.com/cypress-io/cypress/issues/21856
describe('resposive design', () => {
describe('responsive design', () => {
it('small screen (width < md(768px))', () => {
cy.mountFragment(RunsConnectSuccessAlertFragmentDoc, {
render: (gqlVal) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/data-context/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function hasCtx () {

/**
* Gets the current DataContext, used in situations where it's too much work
* to inject it deeply through the class hierearchy in legacy server code, but we
* to inject it deeply through the class hierarchy in legacy server code, but we
* need to reference it anyway, and for the time being we can assume
* there's only one for the lifecycle of the Electron app.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/data-context/src/util/config-file-updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export async function insertValueInJSString (fileContents: string, obj: Record<s
const splicers: Splicer[] = []

if (!objectLiteralNode) {
// if the export is no object litteral
// if the export is no object literal
throw errors.get('COULD_NOT_UPDATE_CONFIG_FILE', obj, 'No export could be found')
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ describe('spec-options', () => {
{ condition: 'period-separated', fileName: 'my.component.js', expectedFileName: 'my.component.cy.js', expectedComponentName: 'MyComponent' },
{ condition: 'dollar', fileName: '$MyComponent.js', expectedFileName: '$MyComponent.cy.js', expectedComponentName: '$MyComponent' },
{ condition: 'underscores', fileName: 'My_Component.js', expectedFileName: 'My_Component.cy.js', expectedComponentName: 'My_Component' },
{ condition: 'mixed period- and hypen-delimited', fileName: 'about-us.component.js', expectedFileName: 'about-us.component.cy.js', expectedComponentName: 'AboutUsComponent' },
{ condition: 'mixed period- and hyphen-delimited', fileName: 'about-us.component.js', expectedFileName: 'about-us.component.cy.js', expectedComponentName: 'AboutUsComponent' },
].forEach(({ condition, fileName, expectedFileName, expectedComponentName }) => {
it(`generates options for ${condition}`, async () => {
const testSpecOptions = new SpecOptions({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ describe('lib/util/config-file-updater', () => {
})

describe('failures', () => {
it('fails if not an object litteral', () => {
it('fails if not an object literal', () => {
const src = [
'const foo = {}',
'export default foo',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('BrowserDataSource', () => {
expect(result[1].custom).to.be.true
})

it('does not add user custom browser if name and version matchnes a machine browser', async () => {
it('does not add user custom browser if name and version matches a machine browser', async () => {
const browser = { ...userBrowser, name: 'aaa', version: '100' }
const machineBrowser = { ...foundBrowserChrome, name: 'aaa', version: '100' }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ describe('findSpecs', () => {
await ctx.fs.remove(projectRoot)
})

it('exludes specs outside `specPattern`, even if passing a generic glob', async () => {
it('excludes specs outside `specPattern`, even if passing a generic glob', async () => {
const specs = await ctx.project.findSpecs({
projectRoot,
testingType: 'e2e',
Expand Down
6 changes: 3 additions & 3 deletions packages/driver/cypress/e2e/commands/actions/check.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ describe('src/cy/commands/actions/check', () => {
})
})

it('eventually passes the assertion on multiple :checkboxs', () => {
it('eventually passes the assertion on multiple :checkboxes', () => {
$(':checkbox').click(function () {
_.delay(() => {
$(this).addClass('checked')
Expand Down Expand Up @@ -598,7 +598,7 @@ describe('src/cy/commands/actions/check', () => {
cy.get(':checkbox:first').check().should('have.class', 'checked')
})

it('throws when cmd recieves values but subject has no value attribute', function (done) {
it('throws when cmd receives values but subject has no value attribute', function (done) {
cy.get('[name=dogs]').check(['husky', 'poodle', 'on']).then(($chk) => {
expect($chk.length).to.eq(4)
})
Expand Down Expand Up @@ -1189,7 +1189,7 @@ describe('src/cy/commands/actions/check', () => {
cy.get(':checkbox:first').uncheck().should('have.class', 'unchecked')
})

it('throws when cmd recieves values but subject has no value attribute', function (done) {
it('throws when cmd receives values but subject has no value attribute', function (done) {
cy.get('[name=dogs]').uncheck(['husky', 'poodle', 'on']).then(($chk) => {
expect($chk.length).to.eq(4)
})
Expand Down
2 changes: 1 addition & 1 deletion packages/driver/cypress/e2e/commands/actions/type.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2425,7 +2425,7 @@ describe('src/cy/commands/actions/type - #type', () => {
})
})

it('releases modfier keys at the end of the shortcut sequence', () => {
it('releases modifier keys at the end of the shortcut sequence', () => {
cy.get(':text:first').type('h{ctrl+alt++}i')
.then(function ($input) {
const table = this.lastLog.invoke('consoleProps').table[2]()
Expand Down
2 changes: 1 addition & 1 deletion packages/driver/cypress/e2e/commands/assertions.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ describe('src/cy/commands/assertions', () => {
/*
* There was a bug (initially discovered as part of https://github.com/cypress-io/cypress/issues/23699 but not
* directly related) in our copy of chai where, when an element with a trailing space was asserted on,
* the log message would oscilate rapidly between two states. This happened because we were re-using a global
* the log message would oscillate rapidly between two states. This happened because we were re-using a global
* regular expression - which tracks internal state.
*
* https://stackoverflow.com/questions/15276873/is-javascript-test-saving-state-in-the-regex
Expand Down
Loading

0 comments on commit 34c8b1f

Please sign in to comment.