Skip to content

Commit

Permalink
add pnpm integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
valerybugakov committed Jan 6, 2023
1 parent b706a0a commit 56506ad
Show file tree
Hide file tree
Showing 14 changed files with 131 additions and 1 deletion.
13 changes: 13 additions & 0 deletions snapshots/input/pnpm-workspaces/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "multi-project",
"version": "1.0.0",
"description": "Example TS/JS project",
"main": "src/main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"private": true,
"packageManager": "[email protected]"
}
11 changes: 11 additions & 0 deletions snapshots/input/pnpm-workspaces/packages/a/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "@example/a",
"version": "1.0.0",
"description": "Example TS/JS project",
"main": "src/a.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
3 changes: 3 additions & 0 deletions snapshots/input/pnpm-workspaces/packages/a/src/a.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function a(): string {
return ''
}
9 changes: 9 additions & 0 deletions snapshots/input/pnpm-workspaces/packages/a/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": ".",
"baseUrl": ".",
"outDir": "dist"
},
"include": ["src/*"]
}
14 changes: 14 additions & 0 deletions snapshots/input/pnpm-workspaces/packages/b/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "@example/b",
"version": "1.0.0",
"description": "Example TS/JS project",
"main": "src/b.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"@example/a": "1.0.0"
}
}
5 changes: 5 additions & 0 deletions snapshots/input/pnpm-workspaces/packages/b/src/b.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { a } from '@example/a'

export function b() {
return a()
}
11 changes: 11 additions & 0 deletions snapshots/input/pnpm-workspaces/packages/b/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": ".",
"baseUrl": "./src",
"sourceRoot": "src",
"outDir": "dist"
},
"include": ["src/*"],
"references": [{ "path": "../a" }]
}

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions snapshots/input/pnpm-workspaces/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions snapshots/input/pnpm-workspaces/pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages:
- 'packages/*'
24 changes: 24 additions & 0 deletions snapshots/input/pnpm-workspaces/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"extends": "@sourcegraph/tsconfig",
"compilerOptions": {
"target": "es2020",
"module": "commonjs",
"allowJs": false,
"moduleResolution": "node",
"esModuleInterop": true,
"lib": ["esnext", "dom", "dom.iterable"],
"sourceMap": true,
"declaration": true,
"declarationMap": true,
"skipLibCheck": true,
"skipDefaultLibCheck": true,
"noErrorTruncation": true,
"importHelpers": true,
"resolveJsonModule": true,
"composite": true,
"outDir": "out",
"rootDir": "."
},
"include": [],
"exclude": ["out", "node_modules", "dist"]
}
8 changes: 8 additions & 0 deletions snapshots/output/pnpm-workspaces/packages/a/src/a.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export function a(): string {
// definition @example/a 1.0.0 src/`a.ts`/
//documentation ```ts\nmodule "a.ts"\n```
// ^ definition @example/a 1.0.0 src/`a.ts`/a().
// documentation ```ts\nfunction a(): string\n```
return ''
}

13 changes: 13 additions & 0 deletions snapshots/output/pnpm-workspaces/packages/b/src/b.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { a } from '@example/a'
// definition @example/b 1.0.0 src/`b.ts`/
//documentation ```ts\nmodule "b.ts"\n```
// ^ reference @example/a 1.0.0 src/`a.ts`/a().
// ^^^^^^^^^^^^ reference @example/a 1.0.0 src/`a.ts`/

export function b() {
// ^ definition @example/b 1.0.0 src/`b.ts`/b().
// documentation ```ts\nfunction b(): string\n```
return a()
// ^ reference @example/a 1.0.0 src/`a.ts`/a().
}

3 changes: 2 additions & 1 deletion src/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ if (isUpdate && fs.existsSync(outputDirectory)) {
}
interface PackageJson {
workspaces: string[]
packageManager?: string
}
for (const snapshotDirectory of snapshotDirectories) {
// Uncomment below if you want to skip certain tests for local development.
Expand All @@ -56,7 +57,7 @@ for (const snapshotDirectory of snapshotDirectories) {
output,
yarnWorkspaces: Boolean(packageJson.workspaces),
yarnBerryWorkspaces: false,
pnpmWorkspaces: false,
pnpmWorkspaces: Boolean(packageJson.packageManager?.includes('pnpm')),
progressBar: false,
indexedProjects: new Set(),
globalCaches: true,
Expand Down

0 comments on commit 56506ad

Please sign in to comment.