-
Notifications
You must be signed in to change notification settings - Fork 2
V0.1 #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
V0.1 #1
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
43dbcd5
Initial commit
Ngwerume 5ba1098
Coverage testing
Ngwerume da41266
Coverage testing
Ngwerume bea76e7
Coverage testing
Ngwerume 39eac87
Coverage testing
Ngwerume 674d14f
Coverage testing
Ngwerume 6007e96
Coverage testing
Ngwerume 810fc4b
Coverage testing
Ngwerume d730a1f
Coverage testing
Ngwerume b0bbf20
Coverage testing
Ngwerume 652fa18
creating reports with errors
Ngwerume 9477391
further tests
Ngwerume e48395f
fixed undefined var
Ngwerume 3f3196d
fixed undefined var
Ngwerume 1272ddb
fixed undefined var
Ngwerume 29a6af0
fixed undefined var
Ngwerume 7ab845b
fixed undefined var
Ngwerume 12652a7
fixed a few more things for the example
Ngwerume 2857c92
fixed a few more things for the example
Ngwerume 7c3ab8e
fixed a few more things for the example
Ngwerume 2064d57
fixed a few more things for the example
Ngwerume a95ee46
fixed a few more things for the example
Ngwerume 6694490
resolving empty coverage
Ngwerume 3afa9c9
resolving empty coverage
Ngwerume 5ba770f
resolving empty coverage
Ngwerume 2a04603
resolving empty coverage
Ngwerume f517f7f
resolving empty coverage
Ngwerume 53a89a8
resolving empty coverage
Ngwerume 48bcf71
resolving empty coverage
Ngwerume 6ef048c
resolving empty coverage
Ngwerume a598235
resolving empty coverage
Ngwerume 0a2e832
resolving empty coverage more
Ngwerume 4b84383
resolving empty coverage more
Ngwerume 6ac4986
resolving empty coverage more
Ngwerume bfac8f7
resolving empty coverage more
Ngwerume 33c19ec
resolving empty coverage more
Ngwerume f64ae13
resolving empty coverage more
Ngwerume 99d4230
resolving empty coverage more
Ngwerume File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| module.exports = { | ||
| env: { | ||
| node: true, | ||
| es6: true, | ||
| jest: true, | ||
| }, | ||
| extends: ['eslint:recommended'], | ||
| plugins: ['jest'], | ||
| rules: { | ||
| 'jest/no-disabled-tests': 'warn', | ||
| 'jest/no-focused-tests': 'error', | ||
| 'jest/no-identical-title': 'error', | ||
| 'jest/valid-expect': 'error', | ||
| }, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| name: Client Side Tools and Coverage | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ '*' ] | ||
| pull_request: | ||
| branches: [ '*' ] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v2 | ||
| with: | ||
| node-version: '18' # Choose your Node.js version | ||
|
|
||
| - name: Run Codacy Analysis CLI with Docker (optional) | ||
| run: | | ||
| export CODACY_CODE=$GITHUB_WORKSPACE | ||
| docker run \ | ||
| --rm=true \ | ||
| --env CODACY_CODE="$CODACY_CODE" \ | ||
| --volume /var/run/docker.sock:/var/run/docker.sock \ | ||
| --volume "$CODACY_CODE":"$CODACY_CODE" \ | ||
| --volume /tmp:/tmp \ | ||
| codacy/codacy-analysis-cli \ | ||
| analyze --tool eslint --upload --project-token ${{ secrets.CODACY_PROJECT_TOKEN }} --max-allowed-issues 99999 --commit-uuid $GITHUB_SHA | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| npm install -g nyc # Install Istanbul (nyc) for code coverage | ||
| npm install # Install project dependencies | ||
| npm install --save-dev nyc | ||
| npm install --save-dev chai | ||
| npm install --save-dev blanket | ||
| npm install --save-dev mocha | ||
| npm install --save-dev mocha-lcov-reporter | ||
|
|
||
| - name: Run tests and collect coverage | ||
| run: | | ||
| # Replace with the actual command to run your tests | ||
| npm test | ||
| continue-on-error: true | ||
|
|
||
| - name: Upload coverage report to Codacy | ||
| env: | ||
| CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} | ||
| run: | | ||
| bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r $GITHUB_WORKSPACE/lcov.info | ||
| continue-on-error: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| const { addNumbers, subtractNumbers } = require('../main'); | ||
| const { expect } = require('chai'); | ||
|
|
||
| // Describe a test suite for main.js | ||
| describe('Main Module', () => { | ||
| // Test the addNumbers function | ||
| describe('addNumbers', () => { | ||
| it('should add two numbers correctly', () => { | ||
| const result = addNumbers(5, 3); | ||
| expect(result).to.equal(8); | ||
| }); | ||
| }); | ||
|
|
||
| // Test the subtractNumbers function | ||
| describe('subtractNumbers', () => { | ||
| it('should subtract two numbers correctly', () => { | ||
| const result = subtractNumbers(10, 3); | ||
| expect(result).to.equal(7); | ||
| }); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| // jest.config.js | ||
|
|
||
| module.exports = { | ||
| testEnvironment: 'node', | ||
| coverageProvider: 'v8', // Use Istanbul (nyc) for code coverage | ||
| collectCoverage: true, | ||
| collectCoverageFrom: ['**/*.js'], | ||
| }; | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| // This is the main JavaScript file of your sample project. | ||
|
|
||
| // Import the utility functions from util.js | ||
| const { add, subtract } = require('./util'); | ||
|
|
||
| // Function to add two numbers | ||
| function addNumbers(a, b) { | ||
| return add(a, b); | ||
| } | ||
|
|
||
| // Function to subtract two numbers | ||
| function subtractNumbers(a, b) { | ||
| return subtract(a, b); | ||
| } | ||
|
|
||
| // Removed the unused variable | ||
| // const unusedVariable = 'This variable is not used'; | ||
|
|
||
| // Removed the missing semicolon | ||
| const missingSemicolon = 'This line is missing a semicolon'; | ||
|
|
||
| // Removed the undefined variable usage | ||
| // console.log(undefinedVariable); | ||
|
|
||
| // Removed the attempt to reassign a constant | ||
| // const constantValue = 42; | ||
| // constantValue = 43; | ||
|
|
||
| // Removed the missing function argument | ||
| // function missingArgument(arg1, arg2) { | ||
| // return arg1 + arg2; | ||
| // } | ||
|
|
||
| module.exports = { | ||
| addNumbers, | ||
| subtractNumbers, | ||
| }; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ Codacy found a minor Code Style issue: 'missingSemicolon' is assigned a value but never used.
The code is flagged by ESLint because it contains a variable
missingSemicolonthat is assigned a value but never used. To fix this issue, you can either remove the variable assignment or use the variable somewhere in your code.This will remove the unused variable and resolve the ESLint error.
This comment was generated by an experimental AI tool.