Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
115 changed files
with
4,008 additions
and
19 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+927 KB
.yarn/cache/@rollup-rollup-linux-arm64-musl-npm-4.9.4-89dfeb5a84-8.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+4.13 KB
.yarn/cache/json-parse-better-errors-npm-1.0.2-7f37637d19-ff2b5ba2a7.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+11.4 KB
.yarn/cache/normalize-package-data-npm-2.5.0-af0345deed-7999112efc.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+10.3 KB
.yarn/cache/string.prototype.padend-npm-3.1.5-b6432b91f7-fc915e0b6a.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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 @@ | ||
test/spec/fixtures/ |
This file contains 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,92 @@ | ||
# vitest-allure | ||
|
||
> Allure framework integration for [Vitest](https://vitest.dev/) framework | ||
<img src="https://allurereport.org/public/img/allure-report.svg" height="85px" alt="Allure Report logo" align="right" /> | ||
|
||
- Learn more about Allure Report at https://allurereport.org | ||
- 📚 [Documentation](https://allurereport.org/docs/) – discover official documentation for Allure Report | ||
- ❓ [Questions and Support](https://github.com/orgs/allure-framework/discussions/categories/questions-support) – get help from the team and community | ||
- 📢 [Official annoucements](https://github.com/orgs/allure-framework/discussions/categories/announcements) – be in touch with the latest updates | ||
- 💬 [General Discussion ](https://github.com/orgs/allure-framework/discussions/categories/general-discussion) – engage in casual conversations, share insights and ideas with the community | ||
|
||
--- | ||
|
||
## Installation | ||
|
||
```bash | ||
npm i -D vitest allure-vitest | ||
``` | ||
|
||
or via yarn: | ||
|
||
```bash | ||
yarn add -D vitest allure-vitest | ||
``` | ||
|
||
## Configuration | ||
|
||
Add instance of the reporter to the [`reporters` section](https://vitest.dev/config/#reporters) of your Vitest config: | ||
|
||
```js | ||
import AllureReporter from "allure-vitest"; | ||
import { defineConfig } from "vitest/config"; | ||
|
||
export default defineConfig({ | ||
test: { | ||
// add setup file to be able to use Allure API via `this.allure` in your tests | ||
setupFiles: ["allure-vitest/setup], | ||
reporters: [ | ||
// do not forget to keep the "default" if you want to see something in the console | ||
"default", | ||
new AllureReporter({ | ||
links: [ | ||
{ | ||
type: "issue", | ||
urlTemplate: "https://example.org/issue/%s", | ||
}, | ||
{ | ||
type: "tms", | ||
urlTemplate: "https://example.org/task/%s", | ||
}, | ||
], | ||
resultsDir: "./allure-results", | ||
}), | ||
], | ||
}, | ||
}); | ||
``` | ||
|
||
## Reporter options | ||
|
||
Some reporter settings can set by following options: | ||
|
||
| Option | Description | Default | | ||
| ---------- | ----------------------------------------------------- | ------------------ | | ||
| resultsDir | Path to results folder | `./allure-results` | | ||
| links | Links templates to make runtime methods calls simpler | `undefined` | | ||
|
||
## API | ||
|
||
If you use setup file shipped by the integration, use `this.allure` to get access | ||
to Allure Runtime API: | ||
|
||
```js | ||
import { test } from "vitest"; | ||
|
||
test("sample test", async () => { | ||
await this.allure.label("foo", "bar"); | ||
}); | ||
``` | ||
|
||
Additionally, you can call Allure Runtime API methods directly passing the | ||
context argument to the method: | ||
|
||
```js | ||
import { test } from "vitest"; | ||
import * as allure from "allure-vitest"; | ||
|
||
test("sample test", async (context) => { | ||
await allure.label(context, "foo", "bar"); | ||
}); | ||
``` |
This file contains 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,64 @@ | ||
{ | ||
"name": "allure-vitest", | ||
"version": "2.10.0", | ||
"description": "Allure Vitest integration", | ||
"license": "Apache-2.0", | ||
"homepage": "https://allurereport.org/", | ||
"author": { | ||
"name": "Qameta Software", | ||
"email": "allure@qameta.io", | ||
"url": "https://qameta.io/" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/allure-framework/allure-js.git", | ||
"directory": "packages/allure-vitest" | ||
}, | ||
"keywords": [ | ||
"vitest", | ||
"typescript", | ||
"allure" | ||
], | ||
"type": "module", | ||
"main": "./dist/src/index.js", | ||
"types": "./dist/src/index.d.ts", | ||
"files": [ | ||
"dist" | ||
], | ||
"exports": { | ||
".": "./dist/src/index.js", | ||
"./setup": "./dist/src/setup.js", | ||
"./reporter": "./dist/src/reporter.js" | ||
}, | ||
"scripts": { | ||
"clean": "rimraf ./dist ./out", | ||
"compile": "tsc", | ||
"generate-report": "allure generate ./out/allure-results -o ./out/allure-report --clean", | ||
"allure-report": "allure serve ./out/allure-results", | ||
"pretest": "run compile", | ||
"test": "vitest run --dir ./test/spec --config ./vitest.config.ts", | ||
"lint": "eslint ./src --ext .ts", | ||
"lint:fix": "eslint ./src --ext .ts --fix" | ||
}, | ||
"dependencies": { | ||
"allure-js-commons": "workspace:*" | ||
}, | ||
"devDependencies": { | ||
"@types/eslint": "^8", | ||
"@types/node": "^20.6.3", | ||
"@typescript-eslint/eslint-plugin": "^6.7.0", | ||
"@typescript-eslint/parser": "^6.7.0", | ||
"eslint": "^8.49.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint-plugin-import": "^2.28.1", | ||
"eslint-plugin-jsdoc": "^46.6.0", | ||
"eslint-plugin-no-null": "^1.0.2", | ||
"eslint-plugin-prefer-arrow": "^1.2.3", | ||
"glob": "^10.3.10", | ||
"npm-run-all": "^4.1.5", | ||
"rimraf": "^5.0.1", | ||
"typescript": "^5.2.2", | ||
"vite": "^5.0.11", | ||
"vitest": "^1.1.3" | ||
} | ||
} |
Oops, something went wrong.