From 12d02373ee62f9540415a1ace5992a17658d6401 Mon Sep 17 00:00:00 2001 From: Pierre Cavin Date: Sun, 10 Sep 2023 18:36:56 +0200 Subject: [PATCH] revert: "test: add TS types check" --- .github/workflows/test.yml | 2 - package.json | 2 - types/index.test-d.ts | 85 -------------------------------------- 3 files changed, 89 deletions(-) delete mode 100644 types/index.test-d.ts diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 424f7023..f5dcb9da 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,7 +29,5 @@ jobs: run: npm run build - name: Check codestyle compliance run: npm run lint - - name: Check TS types - run: npm run test:types - name: Run tests run: npm run test diff --git a/package.json b/package.json index 6f0531ed..82b9a590 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,6 @@ "lint": "eslint {src,tests}/*.js", "test": "jest --coverage", "test:watch": "jest --watch --coverage", - "test:types": "tsd", "prepare": "husky install", "release": "semantic-release" }, @@ -49,7 +48,6 @@ "prettier": "~2.8.x", "semantic-release": "~21.0.x", "sinon": "^15.0.x", - "tsd": "^0.28.1", "typescript": "^5.2.2" }, "keywords": [ diff --git a/types/index.test-d.ts b/types/index.test-d.ts deleted file mode 100644 index 7e5f29b1..00000000 --- a/types/index.test-d.ts +++ /dev/null @@ -1,85 +0,0 @@ -import * as luxon from 'luxon'; -import { expectType } from 'tsd'; -import * as cron from '..'; - -const CronJob = cron.CronJob; -const CronTime = cron.CronTime; - -const DateTime = luxon.DateTime; - -const timeZone = 'America/Los_Angeles'; - -// basic cron usage -const job = new CronJob( - '* * * * * *', - () => {}, - null, - true -); - -// using factory function with parameters object -expectType(cron.job({ - cronTime: '00 30 11 * * 1-5', - onTick: () => {}, - start: false, - timeZone: 'America/Los_Angeles' -})); - -// with timezone -new CronJob( - '* * * * * *', - () => {}, - null, - true, - timeZone -); - -// with onComplete -new CronJob( - '00 30 11 * * 1-5', - () => {}, - () => {}, - true, - timeZone -); - -// with Date -new CronJob( - new Date(), - () => {}, - null, - true, - timeZone -); - -// with Luxon DateTime -new CronJob( - DateTime.local(), - () => {}, - null, - true, - timeZone -); - -// with system commands -new CronJob( - '00 30 11 * * 1-5', - 'ls', - { command: 'ls', args: ['./'] }, - true, - timeZone -); - -// check function return types -expectType(job.lastDate()); -expectType(job.nextDates()); -expectType(job.nextDates(1)); -expectType(job.running); -job.setTime(new CronTime('00 30 11 * * 1-2')); -job.start(); -job.stop(); - -// check cronTime format -new CronTime('* * * * * *'); -new CronTime(new Date()); -new CronTime(DateTime.local());