Skip to content

Commit

Permalink
Fix GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
bokub committed Sep 27, 2024
1 parent efc1a61 commit ca0c941
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- run: npm ci
- run: npm ci --ignore-scripts
- run: npm run build
- run: npm run coverage
if: matrix.node == 20
- name: Update code coverage
if: matrix.node == 20
uses: codecov/codecov-action@v4
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"scripts": {
"build": "rm -fr dist && tsc && rm -fr dist/*.spec.*",
"built-in": "[ ! -f dist/index.js ] && npm run build; node examples/built-in.js",
"test": "FORCE_COLOR=1 vitest run",
"coverage": "FORCE_COLOR=1 vitest run --coverage",
"test": "vitest run",
"coverage": "vitest run --coverage",
"demo": "[ ! -f dist/index.js ] && npm run build; node examples/demo.js",
"lint": "prettier --check .",
"prepare": "husky",
Expand Down
7 changes: 6 additions & 1 deletion src/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { describe, it, expect } from 'vitest';
import { describe, it, expect, beforeEach } from 'vitest';
import chalk from 'chalk';
import gradient, { rainbow, cristal, pastel, atlas } from '.';

describe('Gradient Tests', () => {
beforeEach(() => {
chalk.level = 2;
});

it('should throw an error if wrong gradient arguments are passed', () => {
expect(() => gradient()('abc')).toThrowError('Missing gradient colors');
expect(() => gradient('red')('abc')).toThrowError('Expected an array of colors, received "red"');
Expand Down

0 comments on commit ca0c941

Please sign in to comment.