Skip to content

Commit

Permalink
Merge pull request #6 from Minivera/gui/modernize
Browse files Browse the repository at this point in the history
Modernize the library so it works with modern node without hacks
  • Loading branch information
Minivera authored Oct 2, 2023
2 parents f32e4d7 + 6695c7a commit 65fe329
Show file tree
Hide file tree
Showing 18 changed files with 4,367 additions and 2,286 deletions.
5 changes: 5 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
"ecmaVersion": 2018,
"sourceType": "module"
},
"overrides": [
{
"files": ["**/*.ts", "**/*.tsx"]
}
],
"rules": {
"no-var": "error",
// optional, recommended when using es6+
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: 14
- run: npm ci
- run: npm install
- run: npm run build
- run: npm run lint
- run: npm run test
Expand All @@ -24,9 +24,9 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm install
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
Expand All @@ -38,9 +38,9 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
node-version: 18
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm install
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
name: Pull Request validation
name: Lint, build, and Test

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
on: push

jobs:
lint-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 15.x]
node-version: [16.x, 18.x, 20.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand All @@ -31,14 +27,12 @@ jobs:
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm ci
run: npm install
- name: Run eslint
run: npm run lint
run: npm run lint && npm run tsc
- name: Build with TypeScript
run: npm run build --if-present
- name: Run tests
run: npm run test:coverage
- name: Upload coverage to codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
uses: codecov/codecov-action@v3
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.1.0] - 2023-09-27
### Changed
- Updated the library for Node 16 and above, it now works with modern modules resolution.

### Security
- Fixed security issues with imported packages by updating them.

## [1.0.0] - 2020-01-08
### Added
- Initial release
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Testifyjs
[![codecov](https://codecov.io/gh/Minivera/testifyjs/branch/main/graph/badge.svg?token=A9UVKHB3LL)](https://codecov.io/gh/Minivera/testifyjs)
[![codecov](https://codecov.io/gh/Minivera/testifyjs/graph/badge.svg?token=A9UVKHB3LL)](https://codecov.io/gh/Minivera/testifyjs)
![Pull Request validation](https://github.com/Minivera/testifyjs/workflows/Pull%20Request%20validation/badge.svg)

Testify is a unit-testing framework for JavaScript and TypeScript providing and recognizable experience, but with added
Expand Down
10 changes: 5 additions & 5 deletions lib/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { useState, useEffect } from 'react';
import { render } from 'ink';

import { Suite, Test } from './types';
import { Runner } from './runner';
import { SuiteRunner } from './suite';
import { Logger } from './logger';
import { TestRenderer } from './renderer';
import { Suite, Test } from './types.js';
import { Runner } from './runner.js';
import { SuiteRunner } from './suite.js';
import { Logger } from './logger.js';
import { TestRenderer } from './renderer.js';

export const executions: ((logger: Logger) => Promise<boolean>)[] = [];

Expand Down
2 changes: 1 addition & 1 deletion lib/renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { Box, Static, Text } from 'ink';
import ms from 'ms';

import { LoggingState, SuiteState, TestState } from './logger';
import { LoggingState, SuiteState, TestState } from './logger.js';

interface TestData {
id: number;
Expand Down
4 changes: 2 additions & 2 deletions lib/runner.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RunnerParams, ExecutionFunction, Arranger, Acter, Asserter } from './types';
import { Logger } from './logger';
import { RunnerParams, ExecutionFunction, Arranger, Acter, Asserter } from './types.js';
import { Logger } from './logger.js';

export class Runner {
private readonly name: string;
Expand Down
6 changes: 3 additions & 3 deletions lib/suite.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Test, Suite } from './types';
import { Runner } from './runner';
import { Logger } from './logger';
import { Test, Suite } from './types.js';
import { Runner } from './runner.js';
import { Logger } from './logger.js';

export class SuiteRunner {
private readonly name: string;
Expand Down
Loading

0 comments on commit 65fe329

Please sign in to comment.