Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 1 addition & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ module.exports = {
jest: true
},
rules: {
Comment on lines 5 to 6

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test body is empty. Add expectations like expect(splitInteger(6, 2)).toEqual([3, 3]) to verify equal splitting behavior.

'no-proto': 0,
strict: 0,
'max-len': 0,
'no-proto': 0
},
plugins: ['jest']
Comment on lines 8 to 9

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test body is empty. Add an expectation such as expect(splitInteger(8, 1)).toEqual([8]) to verify single-part behavior.

};
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Test

on:
pull_request:
branches: [ master ]
branches: [ main ]

Comment on lines +5 to 6

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test body is empty. Add assertions using expect() to verify the function returns equal parts when divisible. For example: expect(splitInteger(6, 2)).toEqual([3, 3])

jobs:
build:
Expand All @@ -11,7 +11,7 @@ jobs:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test body is empty. Add assertions to verify the array is sorted in ascending order. For example: expect(splitInteger(17, 4)).toEqual([4, 4, 4, 5]) - note the values are already ascending.

strategy:
matrix:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test body is empty. Add assertions to verify the function handles cases where value < numberOfParts (should add zeros). For example: splitInteger(2, 5) should return [0, 0, 0, 1, 1].

node-version: [12.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v2
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/test.yml-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Test

on:
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules
/dist
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"printWidth": 80
}
1 change: 1 addition & 0 deletions .reviewrelatedfiles
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src/**/*
Loading