Skip to content

Commit

Permalink
docs: fix typos (#17874)
Browse files Browse the repository at this point in the history
Co-authored-by: pierre <pierreantoine.urvoy@gmail.com>
  • Loading branch information
Lioness100 and millsp committed Feb 20, 2023
1 parent dee3080 commit 03eeba9
Show file tree
Hide file tree
Showing 23 changed files with 43 additions and 43 deletions.
6 changes: 3 additions & 3 deletions packages/client/src/__tests__/generation/generator.test.ts
Expand Up @@ -160,7 +160,7 @@ describe('generator', () => {
throw new Error(`Prisma Client didn't get packed properly 🤔`)
}

let doesnNotExistError
let doesNotExistError
try {
await getGenerator({
schemaPath: path.join(__dirname, 'doesnotexist.prisma'),
Expand All @@ -170,9 +170,9 @@ describe('generator', () => {
dataProxy: false,
})
} catch (e) {
doesnNotExistError = e
doesNotExistError = e
} finally {
expect(stripAnsi(doesnNotExistError.message).split('generation' + path.sep)[1]).toMatchInlineSnapshot(
expect(stripAnsi(doesNotExistError.message).split('generation' + path.sep)[1]).toMatchInlineSnapshot(
`doesnotexist.prisma does not exist`,
)
}
Expand Down
Expand Up @@ -37,7 +37,7 @@ describe('referentialActions-onDelete-default-foreign-key-error(mysql)', () => {
create: { title: 'Hello Earth' },
},
profile: {
create: { bio: 'I like pinguins' },
create: { bio: 'I like penguins' },
},
},
})
Expand Down
Expand Up @@ -37,7 +37,7 @@ describe('referentialActions-onDelete-default-foreign-key-error(postgresql)', ()
create: { title: 'Hello Earth' },
},
profile: {
create: { bio: 'I like pinguins' },
create: { bio: 'I like penguins' },
},
},
})
Expand Down
Expand Up @@ -31,7 +31,7 @@ describe('referentialActions-onDelete-default-foreign-key-error(sqlite)', () =>
create: { title: 'Hello Earth' },
},
profile: {
create: { bio: 'I like pinguins' },
create: { bio: 'I like penguins' },
},
},
})
Expand Down
Expand Up @@ -44,7 +44,7 @@ describeIf(!process.env.TEST_SKIP_MSSQL)('referentialActions-onDelete-default-fo
create: { title: 'Hello Earth' },
},
profile: {
create: { bio: 'I like pinguins' },
create: { bio: 'I like penguins' },
},
},
})
Expand Down
Expand Up @@ -47,7 +47,7 @@ describe('referentialActions(mysql)', () => {
create: { title: 'Hello Earth' },
},
profile: {
create: { bio: 'I like pinguins' },
create: { bio: 'I like penguins' },
},
},
})
Expand Down
Expand Up @@ -47,7 +47,7 @@ describe('referentialActions(postgresql)', () => {
create: { title: 'Hello Earth' },
},
profile: {
create: { bio: 'I like pinguins' },
create: { bio: 'I like penguins' },
},
},
})
Expand Down
Expand Up @@ -41,7 +41,7 @@ describe('referentialActions(postgresql)', () => {
create: { title: 'Hello Earth' },
},
profile: {
create: { bio: 'I like pinguins' },
create: { bio: 'I like penguins' },
},
},
})
Expand Down
Expand Up @@ -46,7 +46,7 @@ describeIf(!process.env.TEST_SKIP_MSSQL)('referentialActions(sqlserver)', () =>
create: { title: 'Hello Earth' },
},
profile: {
create: { bio: 'I like pinguins' },
create: { bio: 'I like penguins' },
},
},
})
Expand Down
Expand Up @@ -12,7 +12,7 @@ test('sqlite-variable-limit', async () => {
const prisma = new PrismaClient()
const db = path.join(__dirname, 'dev.db')
if (!fs.existsSync(db)) {
await uncompressFile(db)
await decompressFile(db)
}

await prisma.user.findMany({
Expand Down Expand Up @@ -40,7 +40,7 @@ test('sqlite-variable-limit', async () => {
// })
// }

async function uncompressFile(filename) {
async function decompressFile(filename) {
return new Promise<void>((resolve, reject) => {
const decompress = zlib.createBrotliDecompress()
const input = fs.createReadStream(filename + '.br')
Expand Down
8 changes: 4 additions & 4 deletions packages/client/src/runtime/RequestHandler.ts
Expand Up @@ -76,10 +76,10 @@ type ApplyExtensionsParams = {
export class RequestHandler {
client: Client
dataloader: DataLoader<Request>
private logEmmitter?: EventEmitter
private logEmitter?: EventEmitter

constructor(client: Client, logEmitter?: EventEmitter) {
this.logEmmitter = logEmitter
this.logEmitter = logEmitter
this.client = client
this.dataloader = new DataLoader({
batchLoader: (requests) => {
Expand Down Expand Up @@ -172,8 +172,8 @@ export class RequestHandler {
try {
this.handleRequestError({ error, clientMethod, callsite, transaction })
} catch (err) {
if (this.logEmmitter) {
this.logEmmitter.emit('error', { message: err.message, target: clientMethod, timestamp: new Date() })
if (this.logEmitter) {
this.logEmitter.emit('error', { message: err.message, target: clientMethod, timestamp: new Date() })
}
throw err
}
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/runtime/query.ts
Expand Up @@ -1362,7 +1362,7 @@ function tryInferArgs(
const { isNullable, isRequired } = arg

if (value === null && !isNullable && !isRequired) {
// we don't need to execute this ternery if not necessary
// we don't need to execute this ternary if not necessary
const isAtLeastOne = isInputArgType(inputType.type)
? inputType.type.constraints.minNumFields !== null && inputType.type.constraints.minNumFields > 0
: false
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/runtime/utils/waitForBatch.test.ts
Expand Up @@ -66,7 +66,7 @@ test('rejects with error if one of the promises rejects with non-batch error', a
await expect(result).rejects.toBe(error)
})

test('rejects with error if one of the promises rejects with non-batch error, even if other promsies never resolve', async () => {
test('rejects with error if one of the promises rejects with non-batch error, even if other promises never resolve', async () => {
const error = new Error('nope')
const result = waitForBatch([new Promise(() => {}), Promise.reject(error)])

Expand Down
4 changes: 2 additions & 2 deletions packages/client/tests/functional/_utils/getTestSuiteInfo.ts
Expand Up @@ -125,7 +125,7 @@ function getTestSuiteParametersString(configs: Record<string, string>[]) {
// `ENAMETOOLONG: name too long` as this is used for the directory name

// For `relationMode` tests
// we hardcode how it lookks like for test results
// we hardcode how it looks like for test results
if (config.relationMode !== undefined) {
const providerFlavorStr = config.providerFlavor === undefined ? '' : `providerFlavor=${config.providerFlavor},`
return `relationMode=${config.relationMode},provider=${config.provider},${providerFlavorStr}onUpdate=${config.onUpdate},onDelete=${config.onDelete},id=${config.id}`
Expand All @@ -146,7 +146,7 @@ function getTestSuiteParametersString(configs: Record<string, string>[]) {
export function getTestSuiteSchema(suiteMeta: TestSuiteMeta, matrixOptions: Record<string, string>) {
const schemaStr = require(suiteMeta._schemaPath).default(matrixOptions)

// By default, mini-proxy distiguishes different engine instances using inline schema hash
// By default, mini-proxy distinguishes different engine instances using inline schema hash
// In case 2 tests are running in parallel with identical schema, this can cause all kinds of problems
// Adding a unique comment at the top of schema file forces them to have different hash and avoids
// those problems
Expand Down
2 changes: 1 addition & 1 deletion packages/client/tests/functional/issues/4004/tests.ts
Expand Up @@ -68,7 +68,7 @@ testMatrix.setupTestSuite(({ provider }) => {
const { student1Id } = await seed()

await prisma.studentClass.updateMany({
// Testing we can update fields on the join tabel
// Testing we can update fields on the join table
data: {
studentId: student1Id,
},
Expand Down
Expand Up @@ -114,7 +114,7 @@ testMatrix.setupTestSuite(
}),
).rejects.toThrow(
isSchemaUsingMap && isRelationMode_foreignKeys
? // The snaphsot changes when using @@map/@map, though only the name of the table/field is different
? // The snapshot changes when using @@map/@map, though only the name of the table/field is different
// So we can be less specific here
`Foreign key constraint failed on the field:`
: conditionalError.snapshot({
Expand Down Expand Up @@ -499,7 +499,7 @@ testMatrix.setupTestSuite(
describeIf(['Restrict', 'NoAction'].includes(onUpdate))('onUpdate: Restrict, NoAction', () => {
const expectedErrorUpdateWithNonExistingId =
isSchemaUsingMap && isRelationMode_foreignKeys
? // The snaphsot changes when using @map/@@map, though only the name of the table/field is different
? // The snapshot changes when using @map/@@map, though only the name of the table/field is different
// So we can be less specific here
`Foreign key constraint failed on the field:`
: conditionalError.snapshot({
Expand Down Expand Up @@ -574,7 +574,7 @@ testMatrix.setupTestSuite(
describeIf(['DEFAULT', 'Restrict', 'NoAction', 'SetNull'].includes(onUpdate))(
'onUpdate: DEFAULT, Restrict, NoAction, SetNull',
() => {
const expectedErrorUpdateWithExistingId = isSchemaUsingMap // The snaphsot changes when using @@map/@map, though only the name of the table/field is different
const expectedErrorUpdateWithExistingId = isSchemaUsingMap // The snapshot changes when using @@map/@map, though only the name of the table/field is different
? // So we can ignore the error message
undefined
: conditionalError.snapshot({
Expand Down Expand Up @@ -674,7 +674,7 @@ testMatrix.setupTestSuite(
}),
).rejects.toThrow(
isSchemaUsingMap
? // The snaphsot changes when using @@map/@map, though only the name of the table/field is different
? // The snapshot changes when using @@map/@map, though only the name of the table/field is different
// So we can be less specific here
`Unique constraint failed on the`
: conditionalError.snapshot({
Expand Down Expand Up @@ -870,7 +870,7 @@ testMatrix.setupTestSuite(
() => {
const expectedError =
isSchemaUsingMap && isRelationMode_foreignKeys
? // The snaphsot changes when using @@map/@map, though only the name of the table/field is different
? // The snapshot changes when using @@map/@map, though only the name of the table/field is different
// So we can be less specific here
`Foreign key constraint failed on the field:`
: conditionalError.snapshot({
Expand Down
Expand Up @@ -130,7 +130,7 @@ testMatrix.setupTestSuite(
}),
).rejects.toThrow(
isSchemaUsingMap
? // The snaphsot changes when using @@map/@map, though only the name of the table/field is different
? // The snapshot changes when using @@map/@map, though only the name of the table/field is different
// So we can be less specific here
`Foreign key constraint failed on the field`
: conditionalError.snapshot({
Expand Down Expand Up @@ -348,7 +348,7 @@ testMatrix.setupTestSuite(
}),
).rejects.toThrow(
isSchemaUsingMap
? // The snaphsot changes when using @@map/@map, though only the name of the table/field is different
? // The snapshot changes when using @@map/@map, though only the name of the table/field is different
// So we can ignore the error message here
undefined
: conditionalError.snapshot({
Expand Down Expand Up @@ -528,7 +528,7 @@ testMatrix.setupTestSuite(
() => {
const expectedError =
isSchemaUsingMap && isRelationMode_foreignKeys
? // The snaphsot changes when using @@map/@map, though only the name of the table/field is different
? // The snapshot changes when using @@map/@map, though only the name of the table/field is different
// So we can be less specific here
` constraint `
: conditionalError.snapshot({
Expand Down Expand Up @@ -622,7 +622,7 @@ testMatrix.setupTestSuite(

describeIf(['NoAction'].includes(onDelete))(`onDelete: NoAction`, () => {
const expectedError = isSchemaUsingMap
? // The snaphsot changes when using @@map/@map, though only the name of the table/field is different
? // The snapshot changes when using @@map/@map, though only the name of the table/field is different
// So we can ignore the error message
undefined
: conditionalError.snapshot({
Expand Down Expand Up @@ -749,7 +749,7 @@ testMatrix.setupTestSuite(

await prisma.$transaction([
// Deleting order does not matter anymore
// NoAction allows the check to be deffered until the transaction is committed
// NoAction allows the check to be deferred until the transaction is committed
// (only when the FK set constraint is DEFERRABLE)
prisma[postModel].delete({
where: { id: '1-post-a' },
Expand Down
Expand Up @@ -200,7 +200,7 @@ testMatrix.setupTestSuite(
}),
).rejects.toThrow(
isSchemaUsingMap
? // The snaphsot changes when using @@map/@map, though only the name of the table/field is different
? // The snapshot changes when using @@map/@map, though only the name of the table/field is different
// So we can be less specific here
`Foreign key constraint failed on the field:`
: conditionalError.snapshot({
Expand Down Expand Up @@ -360,7 +360,7 @@ testMatrix.setupTestSuite(
}),
).rejects.toThrow(
isSchemaUsingMap
? // The snaphsot changes when using @@map/@map, though only the name of the table/field is different
? // The snapshot changes when using @@map/@map, though only the name of the table/field is different
// So we can be less specific here
`Foreign key constraint failed on the field:`
: conditionalError.snapshot({
Expand Down Expand Up @@ -451,7 +451,7 @@ testMatrix.setupTestSuite(
}),
).rejects.toThrow(
isSchemaUsingMap
? // The snaphsot changes when using @@map/@map, though only the name of the table/field is different
? // The snapshot changes when using @@map/@map, though only the name of the table/field is different
// So we can be less specific here
`Foreign key constraint failed on the field:`
: conditionalError.snapshot({
Expand Down Expand Up @@ -645,7 +645,7 @@ testMatrix.setupTestSuite(
}),
).rejects.toThrow(
isSchemaUsingMap
? // The snaphsot changes when using @@map/@map, though only the name of the table/field is different
? // The snapshot changes when using @@map/@map, though only the name of the table/field is different
// So we can ignore the error message here
undefined
: conditionalError.snapshot({
Expand Down Expand Up @@ -692,7 +692,7 @@ testMatrix.setupTestSuite(
}),
).rejects.toThrow(
isSchemaUsingMap
? // The snaphsot changes when using @@map/@map, though only the name of the table/field is different
? // The snapshot changes when using @@map/@map, though only the name of the table/field is different
// So we can ignore the error message here
undefined
: conditionalError.snapshot({
Expand Down
2 changes: 1 addition & 1 deletion packages/engine-core/src/binary/BinaryEngine.ts
Expand Up @@ -1054,7 +1054,7 @@ You very likely have the wrong "binaryTarget" defined in the schema.prisma file.
}

/**
* This processes errors that didn't ocur synchronously during a request, and were instead inferred
* This processes errors that didn't occur synchronously during a request, and were instead inferred
* from the STDOUT/STDERR streams of the Query Engine process.
*
* See `setError` for more information.
Expand Down
Expand Up @@ -117,7 +117,7 @@ describe('generatorHandler', () => {
})

test('nonexistent executable', async () => {
const generator = new GeneratorProcess(getExecutable('random path that doesnt exist'))
const generator = new GeneratorProcess(getExecutable("random path that doesn't exist"))
await expect(() => generator.init()).rejects.toThrow()
})
})
2 changes: 1 addition & 1 deletion packages/generator-helper/src/__tests__/invalid-executable
@@ -1,6 +1,6 @@
#!/usr/bin/env node

// let's provoke this to fail by requiring an unexisting module
// let's provoke this to fail by requiring a nonexistent module
require('modulethatdoesnotexist/something')

const { generatorHandler } = require('../generatorHandler')
Expand Down
2 changes: 1 addition & 1 deletion packages/migrate/src/MigrateEngine.ts
Expand Up @@ -225,7 +225,7 @@ export class MigrateEngine {
* Try to make the database empty: no data and no schema.
* On most connectors, this is implemented by dropping and recreating the database.
* If that fails (most likely because of insufficient permissions),
* the engine attemps a “best effort reset” by inspecting the contents of the database and dropping them individually.
* the engine attempts a “best effort reset” by inspecting the contents of the database and dropping them individually.
* Drop and recreate the database. The migrations will not be applied, as it would overlap with applyMigrations.
*/
public reset(): Promise<void> {
Expand Down
4 changes: 2 additions & 2 deletions packages/migrate/src/utils/promptForMigrationName.ts
Expand Up @@ -2,12 +2,12 @@ import { isCi, isInteractive } from '@prisma/internals'
import slugify from '@sindresorhus/slugify'
import { prompt } from 'prompts'

type getMigratioNameOutput = {
type getMigrationNameOutput = {
name?: string
userCancelled?: string
}

export async function getMigrationName(name?: string): Promise<getMigratioNameOutput> {
export async function getMigrationName(name?: string): Promise<getMigrationNameOutput> {
// Truncate if longer
const maxMigrationNameLength = 200

Expand Down

0 comments on commit 03eeba9

Please sign in to comment.