Skip to content

Commit

Permalink
Align absolute path for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
warrensplayer committed May 24, 2023
1 parent bfb6ecd commit 3487209
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/data-context/src/actions/ProjectActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type { ProjectShape } from '../data/coreDataShape'
import type { DataContext } from '..'
import { hasNonExampleSpec } from '../codegen'
import templates from '../codegen/templates'
import { insertValuesInConfigFile } from '../util'
import { insertValuesInConfigFile, toPosix } from '../util'
import { getError } from '@packages/errors'
import { resetIssuedWarnings } from '@packages/config'
import type { RunSpecErrorCode } from '@packages/graphql/src/schemaTypes'
Expand Down Expand Up @@ -606,9 +606,12 @@ export class ProjectActions {
// Now that we're in the correct testingType, verify the requested spec actually exists
// We don't have specs available until a testingType is loaded, so even through we validated
// a matching file exists above it may not end up loading as a valid spec so we validate that here
const spec = this.ctx.project.getCurrentSpecByAbsolute(absoluteSpecPath)
//
// Have to use toPosix here to align windows absolute paths with how the absolute path is storied in the data context
const spec = this.ctx.project.getCurrentSpecByAbsolute(toPosix(absoluteSpecPath))

if (!spec) {
debug(`Spec not found with path: ${absoluteSpecPath}`)
throw new RunSpecError('SPEC_NOT_FOUND', `Unable to find matching spec with path ${absoluteSpecPath}`)
}

Expand Down

0 comments on commit 3487209

Please sign in to comment.