diff --git a/TypeScript/.mocharc.js b/TypeScript/.mocharc.js deleted file mode 100644 index 9ae39f77..00000000 --- a/TypeScript/.mocharc.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; - -module.exports = { - require: [ - "ts-node/register", - "tsconfig-paths/register", - "source-map-support/register" - ], - recursive: true, - spec: "test/mocha/*.spec.ts" -} diff --git a/TypeScript/.nycrc.js b/TypeScript/.nycrc.js deleted file mode 100644 index 3b19d56e..00000000 --- a/TypeScript/.nycrc.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = { - extension: [ - ".ts" - ], - exclude: [ - "**/*.d.ts", - "test/**", - "/*.js" - ], - require: [ - "ts-node/register" - ], - reporter: [ - "html", - "text" - ] -} diff --git a/TypeScript/package.json b/TypeScript/package.json index c7c597e3..b5e53907 100644 --- a/TypeScript/package.json +++ b/TypeScript/package.json @@ -6,30 +6,20 @@ "precompile": "rimraf app/**/*.js test/**/*.js", "compile": "tsc", "pretest": "rimraf app/**/*.js test/**/*.js", - "test:jest": "jest", - "test:jest:watch": "jest --watchAll", - "test:mocha": "nyc mocha", - "test:vitest": "vitest --coverage" + "test": "jest", + "test:watch": "jest --watchAll" }, "license": "MIT", "private": true, "devDependencies": { - "@types/chai": "^4.2.22", "@types/jest": "^29.4.0", - "@types/mocha": "^10.0.1", "@types/node": "^18.14.0", - "@vitest/coverage-istanbul": "^0.28.5", - "chai": "^4.3.4", "jest": "^29.4.3", - "mocha": "^10.2.0", - "nyc": "~15.1.0", "rimraf": "^4.1.2", "source-map-support": "^0.5.20", "ts-jest": "^29.0.5", "ts-node": "^10.9.1", "tsconfig-paths": "^4.1.2", - "typescript": "^4.4.4", - "vite-tsconfig-paths": "^4.0.5", - "vitest": "^0.28.5" + "typescript": "^4.4.4" } } diff --git a/TypeScript/test/mocha/gilded-rose.spec.ts b/TypeScript/test/mocha/gilded-rose.spec.ts deleted file mode 100644 index 02cd24c5..00000000 --- a/TypeScript/test/mocha/gilded-rose.spec.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { expect } from 'chai'; -import { Item, GildedRose } from '@/gilded-rose'; - -describe('Gilded Rose', () => { - it('should foo', () => { - const gildedRose = new GildedRose([new Item('foo', 0, 0)]); - const items = gildedRose.updateQuality(); - expect(items[0].name).to.equal('fixme'); - }); -}); diff --git a/TypeScript/test/vitest/approvals.spec.ts b/TypeScript/test/vitest/approvals.spec.ts deleted file mode 100644 index 858f4a22..00000000 --- a/TypeScript/test/vitest/approvals.spec.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { execSync } from 'node:child_process'; -import { Item, GildedRose } from '@/gilded-rose'; - -/** - * This test uses Vitest Snapshot, similar to [Jest Snapshot](https://goo.gl/fbAQLP). - * - * There are two test cases here with different styles: - *
  • "foo" is more similar to the unit test from the 'Java' version - *
  • "thirtyDays" is more similar to the TextTest from the 'Java' version - * - * I suggest choosing one style to develop and deleting the other. - */ - -describe('Gilded Rose Approval', () => { - it('should foo', () => { - const gildedRose = new GildedRose([new Item('foo', 0, 0)]); - const items = gildedRose.updateQuality(); - - expect(items).toMatchSnapshot(); - }); - - it('should thirtyDays', () => { - const consoleOutput = execSync( - 'ts-node test/golden-master-text-test.ts 30', - { encoding: 'utf-8' } - ); - - expect(consoleOutput).toMatchSnapshot(); - }); -}); diff --git a/TypeScript/test/vitest/gilded-rose.spec.ts b/TypeScript/test/vitest/gilded-rose.spec.ts deleted file mode 100644 index 65330750..00000000 --- a/TypeScript/test/vitest/gilded-rose.spec.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Item, GildedRose } from '@/gilded-rose'; - -describe('Gilded Rose', () => { - it('should foo', () => { - const gildedRose = new GildedRose([new Item('foo', 0, 0)]); - const items = gildedRose.updateQuality(); - expect(items[0].name).toBe('fixme'); - }); -}); diff --git a/TypeScript/vitest.config.ts b/TypeScript/vitest.config.ts deleted file mode 100644 index 73488c68..00000000 --- a/TypeScript/vitest.config.ts +++ /dev/null @@ -1,14 +0,0 @@ -import {defineConfig} from 'vitest/config'; -import tsconfigPaths from 'vite-tsconfig-paths'; - -export default defineConfig({ - plugins: [tsconfigPaths()], - test: { - globals: true, - include: ['test/vitest/**/*.{spec,test}.{js,ts}'], - coverage: { - provider: 'istanbul', - reporter: ['text', 'html'] - } - }, -});