Coder Social home page Coder Social logo

rstefanetti / al-test-runner Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jimmymcp/al-test-runner

1.0 1.0 0.0 309 KB

VS Code Extension to help run AL tests against Business Central container

Home Page: https://jpearson.blog/al-test-runner-for-visual-studio-code/

PowerShell 50.68% TypeScript 49.32%

al-test-runner's Introduction

AL Test Runner

The AL Test Runner extension adds features to help run your Business Central tests and digest the results in VS Code. Run specified tests against your Business Central Docker container and save the results. Test methods are decorated according to the test results. Hover over the method name for more information.

For more information about AL Test Runner and how to use it visit https://jpearson.blog/al-test-runner-for-visual-studio-code/

Features

Running Tests

Adds new commands to easily run:

  • The current test
  • All tests in the current codeunit
  • All tests in the current extension

Run Current Test

Decorate Test Methods According to Test Results

  • Configure background colors for passing, failing and untested test methods
  • Extra details when hovering over the method name e.g. error message and callstack when hovering over failing test

Hover Over Failing Test

Snippet for Test Methods

"ttestprocedure" creates a new global procedure with the [Test] decoration and GIVEN, WHEN, THEN comments ready for you to fill out. The test is immediately highlighted to indicate that it has not been run.

Snippet for Test Methods

Requirements

  • A Business Central Docker container that you can publish your extension into and run your tests against. As of v0.2.0, Docker can either be running locally or on a remote server. If remote, you must be able to execute PowerShell commands against the host with ps-remoting.
  • Alternatively you can use VS Code remote development to execute local PowerShell commands on the host with this extension installed on the host
  • AL Language extension for VS Code
  • navcontainerhelper PowerShell module (minimum version 0.6.4.18)

Extension Settings

  • decorateTestMethods: switch decoration for test methods on/off
  • passingTestsColor: the background color to decorate passing tests with
  • failingTestsColor: the background color to decorate failing tests with
  • untestedTestsColor: the background color to decorate untested tests with
  • publishBeforeTest: determines whether to publish the app to the container before running the test(s) - select between publishing and rapid application publishing
  • highlightFailingLine: whether to decorate the line of code in a test method that has resulted in an error
  • failingLineDecoration: the decoration to apply to the failing line in a test method
  • testCodeunitGlobPattern: the glob pattern that identifies test codeunits e.g. **/Tests/*.codeunit.al will search for files ending in .codeunit.al in a folder called Tests. By default the extension will search through all .al files in the workspace. Enter a more specific glob pattern here to improve performance or remove altogether.

Known Issues

  • When running tests for the first time after loading the extension the terminal that is created to execute the PowerShell commands doesn't show any output - not sure why - the command is running in the background though
  • There is a known bug with the Business Central test tool that causes the PowerShell test runner to fail. This extension will automatically run the command again and the tests should execute successfully second time

al-test-runner's People

Contributors

jimmymcp avatar criticalmax avatar christiansell avatar bjarkihall avatar lksg avatar martonsagi avatar ichladil avatar

Stargazers

 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.