Skip to content

Commit

Permalink
Refactoring and CI workflow maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrahimgunduz34 committed Apr 25, 2022
1 parent d7cf86d commit 2f29caa
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '12', '14', '16' ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: ${{ matrix.node }}
- name: Install Dependencies
run: npm install
- name: Check code style
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@

name: Pull Request Workflow

on: pull_request
on: [pull_request, push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '12', '14', '16' ]
name: Build For Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: ${{ matrix.node }}
- name: Install Dependencies
run: npm install
- name: Check code style
Expand Down
13 changes: 11 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
{
"name": "@ibrahimgunduz34/process-list",
"version": "1.0.12",
"version": "1.0.13",
"description": "It's a library that simply wrap the ps command in order to access the active process list from your application.",
"main": "src/process-list.js",
"scripts": {
"test": "mocha",
"lint": "eslint -c .eslintrc.json ."
},
"keywords": [],
"keywords": [
"system information",
"monitoring",
"backend",
"os",
"linux",
"osx",
"windows",
"freebsd"
],
"author": "Ibrahim Gunduz <ibrahimgunduz34@gmail.com>",
"license": "ISC",
"devDependencies": {
Expand Down
16 changes: 5 additions & 11 deletions tests/process-list.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ describe('ProcessList Tests', () => {
);

ProcessList.getList()
.then(() => {
done('It was expected that getList throws an error');
})
.then(() => done('It was expected that getList throws an error'))
.catch((error) => {
// Chai fails when the error and expected error was compared with `deep.equal`
expect(error).to.include(expectedError);
Expand Down Expand Up @@ -88,10 +86,8 @@ describe('ProcessList Tests', () => {
describe(scenario.scenario, () => {
it(scenario.expectation, (done) => {
ProcessList.getList({ asArray: scenario.asArray })
.then((processes) => {
expect(processes).to.be.deep.equal(scenario.expectedResult);
done();
})
.then((processes) => expect(processes).to.be.deep.equal(scenario.expectedResult))
.then(() => done())
.catch(done);

const output = commandOutputGenerator.createSuccessfulPsOutput();
Expand All @@ -107,10 +103,8 @@ describe('ProcessList Tests', () => {
const expectedResult = expectedResultGenerator.createGetListResultAsObject();

ProcessList.getList()
.then((processes) => {
expect(processes).to.be.deep.equal(expectedResult);
done();
})
.then((processes) => expect(processes).to.be.deep.equal(expectedResult))
.then(() => done())
.catch(done);

const output = commandOutputGenerator.createSuccessfulPsOutput();
Expand Down

0 comments on commit 2f29caa

Please sign in to comment.