Skip to content

Commit

Permalink
add the stub type
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-leonov committed Feb 17, 2020
1 parent dd8bfa8 commit 413db38
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/jest-resolve/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ const nodePaths = NODE_PATH
.map(p => path.resolve(resolvedCwd, p))
: undefined;

// it's temporary here
function newPath(path: Config.Path): Config.RPth {
return {'@@__tag': 'ResolvedPath', path};
}

/* eslint-disable-next-line no-redeclare */
class Resolver {
private readonly _options: ResolverConfig;
Expand Down
4 changes: 4 additions & 0 deletions packages/jest-types/src/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import chalk = require('chalk');
type CoverageProvider = 'babel' | 'v8';

export type Path = string;
// @@__tag is used to simulate an apaque type, useful during refactoring
// Keeping RPth of the same length as Path for now, to keep diffs to minimum
// will rename it later.
export type RPth = {"@@__tag": "ResolvedPath", path: string};

export type Glob = string;

Expand Down

0 comments on commit 413db38

Please sign in to comment.