-
Notifications
You must be signed in to change notification settings - Fork 0
Release 0.3.0-rc #16
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
Merged
Release 0.3.0-rc #16
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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,24 @@ | ||
| { | ||
| "env": { | ||
| "browser": true, | ||
| "es2021": true | ||
| }, | ||
| "extends": [ | ||
| "eslint:recommended", | ||
| "plugin:@typescript-eslint/recommended" | ||
| ], | ||
| "overrides": [ | ||
| ], | ||
| "parser": "@typescript-eslint/parser", | ||
| "parserOptions": { | ||
| "ecmaVersion": "latest", | ||
| "sourceType": "module" | ||
| }, | ||
| "plugins": [ | ||
| "@typescript-eslint" | ||
| ], | ||
| "rules": { | ||
| "semi": ["error", "always"], | ||
| "quotes": ["error", "double"] | ||
| } | ||
| } |
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 @@ | ||
| ## What | ||
|
|
||
| Describe the change. | ||
|
|
||
| ## Why | ||
|
|
||
| Describe the business reason for the change. | ||
|
|
||
| ## How | ||
|
|
||
| Describe the implementation. | ||
|
|
||
| ## Testing | ||
|
|
||
| Describe how to test your changes. |
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 @@ | ||
| # Describes the Dependabot configurations to use for this project. This will automatically open PRs | ||
| # for library upgrades whenever a library can be upgraded or patched. | ||
| # | ||
| # This file will be parsed only on the main project and based on the description outlined here: | ||
| # https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
| # | ||
| # See more information on the job that runs to perform this check, navigate to this link in the | ||
| # Github project: | ||
| # Insights -> Dependency graph -> Dependabot | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: github-actions | ||
| directory: / | ||
| schedule: | ||
| interval: weekly |
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 @@ | ||
| name: NPM Test Coverage | ||
|
|
||
| on: [push] | ||
|
|
||
| jobs: | ||
| npm_test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Use Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20.x' | ||
| - run: npm install | ||
| - run: npm run test | ||
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,20 @@ | ||
| on: | ||
| issue_comment: | ||
| types: [created] | ||
| name: Automatic Rebase | ||
| jobs: | ||
| rebase: | ||
| name: Rebase | ||
| if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout the latest code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Fix git safe.directory in container # see https://github.com/actions/runner/issues/2033 | ||
| run: mkdir -p /home/runner/work/_temp/_github_home && printf "[safe]\n\tdirectory = /github/workspace" > /home/runner/work/_temp/_github_home/.gitconfig | ||
| - name: Automatic Rebase | ||
| uses: cirrus-actions/rebase@1.8 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,36 @@ | ||
| # Dependencies | ||
| node_modules/ | ||
|
|
||
| # Build output | ||
| dist/ | ||
| lib/ | ||
| out/ | ||
|
|
||
| # Logs | ||
| logs/ | ||
| *.log | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
|
|
||
| # IDE and editor files | ||
| .idea/ | ||
| .vscode/ | ||
| *.swp | ||
| *.swo | ||
| .DS_Store | ||
|
|
||
| # Test coverage | ||
| coverage/ | ||
|
|
||
| # npm package files | ||
| *.tgz | ||
| .npmrc | ||
|
|
||
| # Environment variables | ||
| .env | ||
| .env.local | ||
| .env.*.local | ||
|
|
||
| # CDKTF output | ||
| cdktf.out/ |
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 @@ | ||
| 20.11 |
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,58 @@ | ||
| import * as core from "@actions/core"; | ||
| import { RunDiff } from "../src/runDiff"; | ||
| import run from "../src/index"; | ||
|
|
||
| // Mock dependencies | ||
| jest.mock("@actions/core"); | ||
| jest.mock("../src/runDiff", () => ({ | ||
| RunDiff: jest.fn() | ||
| })); | ||
|
|
||
| describe("index", () => { | ||
| beforeEach(() => { | ||
| jest.clearAllMocks(); | ||
| }); | ||
|
|
||
| it("should execute RunDiff successfully", async () => { | ||
| // Mock RunDiff implementation | ||
| const mockRun = jest.fn(); | ||
| (RunDiff as jest.Mock).mockImplementation(() => ({ | ||
| run: mockRun | ||
| })); | ||
|
|
||
| await run(); | ||
|
|
||
| // Verify RunDiff was instantiated and run was called | ||
| expect(RunDiff).toHaveBeenCalledTimes(1); | ||
| expect(mockRun).toHaveBeenCalledTimes(1); | ||
| expect(core.setFailed).not.toHaveBeenCalled(); | ||
| }); | ||
|
|
||
| it("should handle Error objects", async () => { | ||
| // Mock RunDiff to throw an Error | ||
| const errorMessage = "Test error"; | ||
| const mockRun = jest.fn().mockRejectedValue(new Error(errorMessage)); | ||
| (RunDiff as jest.Mock).mockImplementation(() => ({ | ||
| run: mockRun | ||
| })); | ||
|
|
||
| await run(); | ||
|
|
||
| // Verify error was handled correctly | ||
| expect(core.setFailed).toHaveBeenCalledWith(errorMessage); | ||
| }); | ||
|
|
||
| it("should handle non-Error objects", async () => { | ||
| // Mock RunDiff to throw a string | ||
| const errorString = "String error"; | ||
| const mockRun = jest.fn().mockRejectedValue(errorString); | ||
| (RunDiff as jest.Mock).mockImplementation(() => ({ | ||
| run: mockRun | ||
| })); | ||
|
|
||
| await run(); | ||
|
|
||
| // Verify error was handled correctly | ||
| expect(core.setFailed).toHaveBeenCalledWith(errorString); | ||
| }); | ||
| }); |
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.
Is there a reason you added running these tests in Github instead of CCI?
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.
@d10zero that was how it was already setup - see here
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.
would we rather CCI?
Uh oh!
There was an error while loading. Please reload this page.
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.
No I think this is fine! I think its easier/cleaner in github since we are just running
npm test- and we don't make changes to this repo often