From b1e7eb4cd846c2c3e4d2407110b11af968ca9d3c Mon Sep 17 00:00:00 2001 From: anilmisirlioglu Date: Tue, 3 Nov 2020 21:30:14 +0300 Subject: [PATCH] add new tests, version upgrade --- package.json | 4 ++-- tests/unit/version.test.ts | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 tests/unit/version.test.ts diff --git a/package.json b/package.json index 9cd548b..aa1c9d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "asena", - "version": "1.3.3", + "version": "1.3.4", "description": "Fast and reliable raffle and poll bot for Discord", "homepage": "https://asena.xyz", "main": "./src/index.ts", @@ -25,7 +25,7 @@ "build": "tsc", "start:dev": "nodemon --ext ts-node src/index.ts", "start": "NODE_ENV=production node build/index.js", - "test": "mocha -r ts-node/register tests/*.test.ts" + "test": "mocha -r ts-node/register tests/unit/*.test.ts" }, "dependencies": { "child_process": "^1.0.2", diff --git a/tests/unit/version.test.ts b/tests/unit/version.test.ts new file mode 100644 index 0000000..c41da9e --- /dev/null +++ b/tests/unit/version.test.ts @@ -0,0 +1,12 @@ +import 'mocha'; +import Version from '../../src/utils/Version'; +import assert from 'assert'; + +describe('Version Test', () => { + it('must be greater than or equal to the last version', () => { + const currentVersion = new Version('1.3.4') + const packageVersion = new Version(process.env.npm_package_version) + + assert.notStrictEqual(currentVersion.compare(packageVersion), -1) + }) +})