diff --git a/.eslintrc.js b/.eslintrc.js index 95ecf27f..f44c7a1d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -4,9 +4,7 @@ module.exports = { jest: true }, rules: { - 'no-proto': 0, - strict: 0, - 'max-len': 0, + 'no-proto': 0 }, plugins: ['jest'] }; diff --git a/.github/workflows/test.yml-template b/.github/workflows/test.yml-template new file mode 100644 index 00000000..bb13dfc4 --- /dev/null +++ b/.github/workflows/test.yml-template @@ -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 diff --git a/package.json b/package.json index f782ac5a..7a83136a 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "license": "GPL-3.0", "devDependencies": { "@mate-academy/eslint-config": "*", - "@mate-academy/scripts": "^0.9.7", + "@mate-academy/scripts": "^2.1.1", + "@types/jest": "^30.0.0", "eslint": "^5.16.0", "eslint-plugin-jest": "^22.4.1", "eslint-plugin-node": "^8.0.1", diff --git a/src/splitInteger.test.js b/src/splitInteger.test.js index a610317d..2c8cb0d7 100644 --- a/src/splitInteger.test.js +++ b/src/splitInteger.test.js @@ -4,18 +4,18 @@ const splitInteger = require('./splitInteger'); test(`should split a number into equal parts if a value is divisible by a numberOfParts`, () => { - + expect(splitInteger(6, 2)).toEqual([3, 3]); }); test(`should return a part equals to a value when splitting into 1 part`, () => { - + expect(splitInteger(8, 1)).toEqual([8]); }); test('should sort parts ascending if they are not equal', () => { - + expect(splitInteger(32, 6)).toEqual([5, 5, 5, 5, 6, 6]); }); test('should add zeros if value < numberOfParts', () => { - + expect(splitInteger(4, 6)).toEqual([0, 0, 1, 1, 1, 1]); });