Skip to content
Merged
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
54ee96f
chore: update nyc coverage threshold
maverick1872 Aug 9, 2025
a960599
chore: install latest jest
maverick1872 Jul 31, 2025
3d7d2ec
chore: create initial jest configuration
maverick1872 Jul 31, 2025
9319fa7
chore: add jest globals to eslint config
maverick1872 Aug 8, 2025
d7d8c0d
chore: convert mocha syntax to jest syntax
maverick1872 Jul 31, 2025
257929e
chore: skip test due to jest detecting open handles from it
maverick1872 Jul 31, 2025
a3a5cc1
fix: convert test accordingly for jest runtime
maverick1872 Aug 1, 2025
ed15ed4
fix: replace incomplete test with todo for issue 2103
maverick1872 Aug 1, 2025
18b62ed
fix: make legacy logger tests jest compatible
maverick1872 Aug 1, 2025
008fb4a
fix: correct unknown log level test for jest runtime
maverick1872 Aug 2, 2025
39d6498
fix: refactor file-archive.test and make significantly more clear
maverick1872 Aug 2, 2025
3c10734
fix: consolidate file archive tests
maverick1872 Aug 3, 2025
0ff03c2
chore: remove unused dependencies
maverick1872 Aug 3, 2025
82d2c82
fix: correct referenced npm command in ci workflow
maverick1872 Aug 3, 2025
f219e10
chore: revert to previous assertion style
maverick1872 Aug 3, 2025
4de6df5
chore: consolidate file transport tests
maverick1872 Aug 3, 2025
4cbecb6
chore: re-enable test
maverick1872 Aug 3, 2025
f208bed
chore: drop jest to v29.x to maintain node 16 support
maverick1872 Aug 3, 2025
3949a81
chore: add tests for log level instance methods
maverick1872 Aug 3, 2025
067e73d
chore: temp disable coverage thresholds
maverick1872 Aug 3, 2025
4cb6b66
chore: reenable coverage to figured out why it behaves differently
maverick1872 Aug 7, 2025
a408e4c
fix: update exception handler tests to pass with jest
maverick1872 Aug 7, 2025
c684258
chore: cleanup tests
maverick1872 Aug 8, 2025
b29547b
chore: cleanup jest configs
maverick1872 Aug 9, 2025
f8d23af
chore: cleanup
maverick1872 Aug 9, 2025
1ed361b
chore: format printed line
maverick1872 Aug 9, 2025
b5b237f
chore: cleanup and leverage await rather than timeouts
maverick1872 Aug 9, 2025
f2f5c4c
fix: update node types to resolve failing typescript changes caused b…
maverick1872 Aug 9, 2025
46d8c00
chore: make ci not fail fast to help identify if issue is specific to…
maverick1872 Aug 9, 2025
741d0f8
chore: update jest coverage threshold
maverick1872 Aug 9, 2025
58f2aa3
chore: address missing coverage and cleanup helpers
maverick1872 Aug 10, 2025
926ec37
chore: cleanup mocha and nyc configs
maverick1872 Aug 10, 2025
cbc160e
fix: cleanup exception stream tests that were missed
maverick1872 Aug 10, 2025
34924e4
chore: address readme copilot feedback
maverick1872 Oct 3, 2025
922c9f8
chore: add contributor
maverick1872 Oct 3, 2025
80f551e
chore: resolve merge conflicts
maverick1872 Oct 3, 2025
2b89a20
fix: remove duplicate dependency reference
maverick1872 Oct 3, 2025
815b2d1
chore: address copilot feedback round 2
maverick1872 Oct 3, 2025
7cfdaa1
chore: address final copilot comment
maverick1872 Oct 3, 2025
29ae48b
chore: fix package-lock
maverick1872 Oct 3, 2025
d67ca99
fix: add argument to the correct asstion this time round and make exp…
maverick1872 Oct 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"env": {
"jest": true,
},
"extends": "@dabh/eslint-config-populist",
"rules": {
"one-var": ["error", { "var": "never", "let": "never", "const": "never" }],
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node:
- 16
Expand All @@ -31,18 +32,24 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- name: Install Dependencies
run: npm clean-install

- name: Lint
run: npm run lint

- name: Unit Tests (with coverage)
run: npm run test:unit

- name: Integration Tests
run: npm run test:integration
- name: Test Coverage
run: npm run test:coverage

- name: Report test coverage to Coveralls.io
if: matrix.node == '20'
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: TypeScript Test
run: npx --package typescript tsc --project test
run: npm run test:typescript
5 changes: 0 additions & 5 deletions .mocharc.yml

This file was deleted.

8 changes: 0 additions & 8 deletions .nycrc.yml

This file was deleted.

18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1234,15 +1234,17 @@ yarn add winston

## Run Tests

All of the winston tests are written with [`mocha`][mocha], [`nyc`][nyc], and
[`assume`][assume]. They can be run with `npm`.

``` bash
npm test
npm test # Runs all tests
npm run test:unit # Runs all Unit tests with coverage
npm run test:integration # Runs all integration tests
npm run test:typescript # Runs tests verifying Typescript types
```

All of the winston tests are written with [jest]. Assertions use a mix of [assume] and the built-in jest assertion library.

#### Author: [Charlie Robbins]
#### Contributors: [Jarrett Cruger], [David Hyde], [Chris Alderson]
#### Contributors: [Jarrett Cruger], [David Hyde], [Chris Alderson], [Jonathon Terry]

[Transports]: #transports
[Logging levels]: #logging-levels
Expand All @@ -1254,11 +1256,10 @@ npm test

[RFC5424]: https://tools.ietf.org/html/rfc5424
[util.format]: https://nodejs.org/dist/latest/docs/api/util.html#util_util_format_format_args
[mocha]: https://mochajs.org
[nyc]: https://github.com/istanbuljs/nyc
[assume]: https://github.com/bigpipe/assume
[logform]: https://github.com/winstonjs/logform#readme
[winston-transport]: https://github.com/winstonjs/winston-transport
[jest]: https://jestjs.io/

[Read the `winston@2.x` documentation]: https://github.com/winstonjs/winston/tree/2.x

Expand All @@ -1268,4 +1269,5 @@ npm test
[Charlie Robbins]: http://github.com/indexzero
[Jarrett Cruger]: https://github.com/jcrugzz
[David Hyde]: https://github.com/dabh
[Chris Alderson]: https://github.com/chrisalderson
[Chris Alderson]: https://github.com/chrisalderson
[Jonathon Terry]: https://github.com/maverick1872
26 changes: 26 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* @type {import('@jest/types').Config.InitialOptions}
*/
module.exports = {
collectCoverage: false,
collectCoverageFrom: [
'<rootDir>/lib/**/*.js'
],
coverageDirectory: 'coverage',
testEnvironment: 'node',
testMatch: [
'<rootDir>/test/**/*.test.js'
],
globalSetup: '<rootDir>/test/globalSetup.js',
silent: true,
verbose: true,
coverageThreshold: {
global: {
functions: 74.54,
lines: 72.48,
statements: 72.25,
branches: 64.04
}
}
};

2 changes: 1 addition & 1 deletion lib/winston/profiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ class Profiler {

return this.logger.write(info);
}
};
}

module.exports = Profiler;
Loading
Loading