From b4cc08eadca9d3c5fa6e43759ca373125f43005d Mon Sep 17 00:00:00 2001 From: Cweili <3weili@gmail.com> Date: Tue, 16 Jan 2024 14:58:21 +0800 Subject: [PATCH] refactor: props defaults --- .github/workflows/ci.yml | 2 +- package.json | 2 +- src/lib/fa-layers-text.svelte | 14 +++++++------- src/lib/fa-layers.svelte | 14 +++++++------- src/lib/fa.svelte | 20 ++++++++++---------- src/lib/utils.ts | 6 +++--- {src => test}/basic.test.ts | 2 +- {src => test}/duotone.test.ts | 2 +- {src => test}/layers.test.ts | 2 +- vite.config.ts | 3 ++- 10 files changed, 34 insertions(+), 33 deletions(-) rename {src => test}/basic.test.ts (99%) rename {src => test}/duotone.test.ts (98%) rename {src => test}/layers.test.ts (98%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f4eefd..db4b6db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: - run: npm run check - run: npm run lint - run: npm run build - - run: npm test -- --coverage.enabled --coverage.include=src/lib/** + - run: npm test - uses: coverallsapp/github-action@master with: diff --git a/package.json b/package.json index 7f8bb32..0e040f8 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "prepublishOnly": "npm run package", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", - "test": "vitest --typecheck", + "test": "vitest --typecheck --coverage.enabled", "lint": "prettier --check . && eslint --ignore-path .gitignore .", "format": "prettier --write ." }, diff --git a/src/lib/fa-layers-text.svelte b/src/lib/fa-layers-text.svelte index 97a86c0..4e26fe6 100644 --- a/src/lib/fa-layers-text.svelte +++ b/src/lib/fa-layers-text.svelte @@ -1,22 +1,22 @@ @@ -23,7 +23,7 @@ class:svelte-fa-size-sm={size === "sm"} class:svelte-fa-size-xs={size === "xs"} bind:this={containerElement} - style={style !== "" ? style : null} + {style} > diff --git a/src/lib/fa.svelte b/src/lib/fa.svelte index 4d1d50c..d4a5524 100644 --- a/src/lib/fa.svelte +++ b/src/lib/fa.svelte @@ -1,16 +1,16 @@