nushell/crates
Máté FARKAS c3678764b4
stdlib test runner: implement setup and teardown commands to unit tests (#8776)
# Description

As in other testing frameworks, the `setup` runs before every test case,
and the `teardown` after that. A context can be created in `setup`,
which will be in the `$in` variable in the test cases, and in the
`teardown`. The `teardown` is called regardless of the test is passed,
skipped, or failed.

For example:

```nushell
use std.nu *

export def setup [] {
    log debug "Setup is running"
    {msg: "This is the context"}
}

export def teardown [] {
    log debug $"Teardown is running. Context: ($in)"
}

export def test_assert_pass [] {
    log debug $"Assert is running. Context: ($in)"
}

export def test_assert_skip [] {
    log debug $"Assert is running. Context: ($in)"
    assert skip
}

export def test_assert_fail_skipped_by_default [] {
    log debug $"Assert is running. Context: ($in)"
    assert false
}
```


![image](https://user-images.githubusercontent.com/282320/230466359-9908cc72-edbd-4150-9aff-d15fe42c0cc7.png)

# After Submitting

I'll update the documentation.

---------

Co-authored-by: Mate Farkas <Mate.Farkas@oneidentity.com>
2023-04-10 22:42:11 +02:00
..
nu_plugin_custom_values Bump to 0.78.1 development version (#8741) 2023-04-05 13:36:10 +12:00
nu_plugin_example Bump to 0.78.1 development version (#8741) 2023-04-05 13:36:10 +12:00
nu_plugin_formats Bump to 0.78.1 development version (#8741) 2023-04-05 13:36:10 +12:00
nu_plugin_gstat Bump git2 from 0.16.1 to 0.17.0 (#8722) 2023-04-05 19:20:58 +00:00
nu_plugin_inc Bump to 0.78.1 development version (#8741) 2023-04-05 13:36:10 +12:00
nu_plugin_python update nu_plugin_python due to signature changes (#8107) 2023-02-18 13:27:24 +00:00
nu_plugin_query Bump to 0.78.1 development version (#8741) 2023-04-05 13:36:10 +12:00
nu-cli Move CLI related commands to nu-cli (#8832) 2023-04-10 10:56:47 +12:00
nu-cmd-lang Remove autoprinting of for loop (#8843) 2023-04-11 05:23:22 +12:00
nu-color-config Add IDE support (#8745) 2023-04-06 07:34:47 +12:00
nu-command Fix process_range on 32-bit platforms (#8842) 2023-04-11 06:52:42 +12:00
nu-engine Add $nu.current-exe variable (#8789) 2023-04-07 13:51:09 -05:00
nu-explore Remove old alias implementation (#8797) 2023-04-07 21:09:38 +03:00
nu-glob Bump to 0.78.1 development version (#8741) 2023-04-05 13:36:10 +12:00
nu-json Bump to 0.78.1 development version (#8741) 2023-04-05 13:36:10 +12:00
nu-parser Follow up #8758 with a style fix (#8822) 2023-04-09 18:42:43 -07:00
nu-path Correction bug multiple dots mkdir and touch (#8486) 2023-04-05 20:22:56 +03:00
nu-plugin Bump to 0.78.1 development version (#8741) 2023-04-05 13:36:10 +12:00
nu-pretty-hex Bump to 0.78.1 development version (#8741) 2023-04-05 13:36:10 +12:00
nu-protocol Only add the std lib files once (#8830) 2023-04-10 08:55:47 +12:00
nu-std stdlib test runner: implement setup and teardown commands to unit tests (#8776) 2023-04-10 22:42:11 +02:00
nu-system Add ppid to ps command (#8750) 2023-04-05 13:12:01 -05:00
nu-table Bump to 0.78.1 development version (#8741) 2023-04-05 13:36:10 +12:00
nu-term-grid Bump to 0.78.1 development version (#8741) 2023-04-05 13:36:10 +12:00
nu-test-support Add option to not load std-lib. Default tests to not use std-lib (#8833) 2023-04-10 10:55:29 +12:00
nu-utils stdlib: make the library a standalone crate (#8770) 2023-04-07 22:12:27 +02:00
README.md Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00

Nushell core libraries and plugins

These sub-crates form both the foundation for Nu and a set of plugins which extend Nu with additional functionality.

Foundational libraries are split into two kinds of crates:

  • Core crates - those crates that work together to build the Nushell language engine
  • Support crates - a set of crates that support the engine with additional features like JSON support, ANSI support, and more.

Plugins are likewise also split into two types:

  • Core plugins - plugins that provide part of the default experience of Nu, including access to the system properties, processes, and web-connectivity features.
  • Extra plugins - these plugins run a wide range of different capabilities like working with different file types, charting, viewing binary data, and more.