Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

allure-jasmine

Package Overview
Dependencies
Maintainers
0
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

allure-jasmine

Allure Jasmine integration

  • 3.0.0-beta.11
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

allure-jasmine

Allure integration Jasmine framework

Allure Report logo


Installation

Use your favorite node package manager to install required packages:

npm add -D allure-jasmine

Create spec/helpers/setup.ts file with following content:

const AllureJasmineReporter = require("allure-jasmine");

const reporter = new AllureJasmineReporter();

jasmine.getEnv().addReporter(reporter);

Check that the helper matches with helper field in your spec/support/jasmine.json file.

Use Allure runtime Api

The plugin provides custom commands which allow to add additional info inside your tests:

import { epic, attachment, parameter } from "allure-js-commons";

it("my test", async () => {
  await attachment("Attachment name", "Hello world!", "text/plain");
  await epic("my_epic");
  await parameter("parameter_name", "parameter_value", {
    mode: "hidden",
    excluded: false,
  });
});
import { link, issue, tms } from "allure-js-commons";

it("basic test", async () => {
  await link("https://allurereport.org", "link type", "Allure Report");
  await issue("https://github.com/allure-framework/allure-js/issues/352", "Issue Name", );
  await tms("https://github.com/allure-framework/allure-js/tasks/352", "Task Name");
});

You can also configure links formatters to make usage much more convenient. %s in urlTemplate parameter will be replaced by given value.

```ts
const AllureJasmineReporter = require("allure-jasmine");

const reporter = new AllureJasmineReporter({
+  links: [
+    {
+      type: "issue",
+      urlTemplate: "https://example.org/issues/%s",
+      nameTemplate: "Issue: %s",
+    },
+    {
+      type: "tms",
+      urlTemplate: "https://example.org/tasks/%s"
+    },
+    {
+      type: "custom",
+      urlTemplate: "https://example.org/custom/%s"
+    },
+  ],
});

jasmine.getEnv().addReporter(reporter);

Then you can assign link using shorter notation:

import { link, issue, tms } from "allure-js-commons";

it("basic test", async () => {
  await issue("351");
  await issue("352", "Issue Name");
  await tms("351");
  await tms("352", "Task Name");
  await link("custom", "352");
  await link("custom", "352", "Link name");
});

Steps usage

The integration supports Allure steps, use them in following way:

import { step } from "allure-js-commons";

it("my test", async () => {
  await step("foo", async () => {
    await step("bar", async () => {
      await step("baz", async () => {});
    });
  });
});

FAQs

Package last updated on 29 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc