Skip to content

Conversation

Copy link

Copilot AI commented Oct 29, 2025

The Contribute.md documentation lacked practical guidance on how to add unit tests when contributing to AL-Go, despite the repository having comprehensive unit test infrastructure.

Changes

  • Added "Testing your contributions" overview explaining when to add unit tests
  • Enhanced "Unit tests" section with:
    • Step-by-step instructions for creating Pester test files
    • Example test structure following Arrange-Act-Assert pattern
    • Best practices (mocking, InModuleScope, cleanup)
    • Commands to run tests locally (pwsh -File Tests/runtests.ps1 -Path Tests)

Example

Import-Module (Join-Path $PSScriptRoot '../Actions/.Modules/MyModule.psm1') -Force

Describe "MyFeature tests" {
    It 'Should do something specific' {
        # Arrange
        Mock Write-Host { }
        
        # Act
        $result = MyFunction -Parameter "value"
        
        # Assert
        $result | Should -Be "expected"
    }
}
Original prompt

I want you to look through the Contribute.md and make add some notes on how you can add tests when you're contributing to AL-Go


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: aholstrup1 <117829001+aholstrup1@users.noreply.github.com>
Copilot AI changed the title [WIP] Add notes on adding tests in contribute.md Add testing guidelines to Contribute.md Oct 29, 2025
Copilot AI requested a review from aholstrup1 October 29, 2025 09:47
Copilot finished work on behalf of aholstrup1 October 29, 2025 09:47
@aholstrup1
Copy link
Owner

@copilot Remove the E2E things for now. To begin with I just want unit tests described

Co-authored-by: aholstrup1 <117829001+aholstrup1@users.noreply.github.com>
Copy link
Author

Copilot AI commented Oct 29, 2025

@copilot Remove the E2E things for now. To begin with I just want unit tests described

Removed all E2E testing documentation. The Contribute.md now focuses exclusively on unit test guidelines. (87fa8eb)

Copilot AI changed the title Add testing guidelines to Contribute.md Add unit testing guidelines to Contribute.md Oct 29, 2025
Copilot finished work on behalf of aholstrup1 October 29, 2025 09:55
Removed the guideline to follow the Arrange-Act-Assert pattern from best practices for unit tests.
@aholstrup1 aholstrup1 marked this pull request as ready for review October 29, 2025 10:01
@aholstrup1 aholstrup1 merged commit 1c0d3e5 into main Oct 29, 2025
4 of 5 checks passed
aholstrup1 added a commit that referenced this pull request Oct 29, 2025
* Initial plan

* Add comprehensive testing notes to Contribute.md

Co-authored-by: aholstrup1 <117829001+aholstrup1@users.noreply.github.com>

* Remove E2E testing documentation, keep only unit tests

Co-authored-by: aholstrup1 <117829001+aholstrup1@users.noreply.github.com>

* Update unit test best practices

Removed the guideline to follow the Arrange-Act-Assert pattern from best practices for unit tests.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: aholstrup1 <117829001+aholstrup1@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants