Move test fixtures to parent directory

This commit is contained in:
Han Yeong-woo 2023-09-02 06:49:03 +09:00
parent 11f981cea4
commit 2375787b23
No known key found for this signature in database
GPG key ID: A46E340CB4E4D6AD
13 changed files with 39 additions and 8 deletions

View file

@ -116,7 +116,7 @@ jobs:
- name: Support packageManager variable
uses: ./
with:
workingDirectory: "./test/fixtures/empty"
workingDirectory: "./test/empty"
packageManager: "npm"
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
@ -125,7 +125,7 @@ jobs:
- name: Support npm package manager
uses: ./
with:
workingDirectory: "./test/fixtures/npm"
workingDirectory: "./test/npm"
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: deploy --dry-run
@ -133,7 +133,7 @@ jobs:
- name: Support yarn package manager
uses: ./
with:
workingDirectory: "./test/fixtures/yarn"
workingDirectory: "./test/yarn"
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: deploy --dry-run
@ -141,7 +141,7 @@ jobs:
- name: Support pnpm package manager
uses: ./
with:
workingDirectory: "./test/fixtures/pnpm"
workingDirectory: "./test/pnpm"
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: deploy --dry-run

View file

@ -42,19 +42,19 @@ describe("detectPackageManager", () => {
});
test("should return npm if package-lock.json exists", () => {
expect(detectPackageManager("test/fixtures/npm")).toBe("npm");
expect(detectPackageManager("test/npm")).toBe("npm");
});
test("should return yarn if yarn.lock exists", () => {
expect(detectPackageManager("test/fixtures/yarn")).toBe("yarn");
expect(detectPackageManager("test/yarn")).toBe("yarn");
});
test("should return pnpm if pnpm-lock.yaml exists", () => {
expect(detectPackageManager("test/fixtures/pnpm")).toBe("pnpm");
expect(detectPackageManager("test/pnpm")).toBe("pnpm");
});
test("should return null if no package manager is detected", () => {
expect(detectPackageManager("test/fixtures/empty")).toBe(null);
expect(detectPackageManager("test/empty")).toBe(null);
});
});

3
test/empty/package.json Normal file
View file

@ -0,0 +1,3 @@
{
"name": "wrangler-action-detect-package-manager-test"
}

View file

View file

View file

View file

10
test/npm/package-lock.json generated Normal file
View file

@ -0,0 +1,10 @@
{
"name": "wrangler-action-npm-test",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "wrangler-action-npm-test"
}
}
}

3
test/npm/package.json Normal file
View file

@ -0,0 +1,3 @@
{
"name": "wrangler-action-npm-test"
}

3
test/pnpm/package.json Normal file
View file

@ -0,0 +1,3 @@
{
"name": "wrangler-action-pnpm-test"
}

5
test/pnpm/pnpm-lock.yaml Normal file
View file

@ -0,0 +1,5 @@
lockfileVersion: '6.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false

3
test/yarn/package.json Normal file
View file

@ -0,0 +1,3 @@
{
"name": "wrangler-action-yarn-test"
}

4
test/yarn/yarn.lock Normal file
View file

@ -0,0 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1