vitalishapovalov / jest-decorated Goto Github PK
View Code? Open in Web Editor NEWDecorators library for writing jest-based tests
Home Page: https://vitalishapovalov.github.io/jest-decorated/
License: MIT License
Decorators library for writing jest-based tests
Home Page: https://vitalishapovalov.github.io/jest-decorated/
License: MIT License
is there some way that can be used so I can extract some info from test spec files, like name of the test suites, test case titles...etc without executing any test?
in my jest config
setupFilesAfterEnv: [
'./jest.setup.js'
, "@jest-decorated/core/globals"
],
in my setup.ts
import "@jest-decorated/core/globals";
module.exports = async function () {
};
other dependencies
"dependencies": {
"@babel/core": "^7.11.1",
"@babel/preset-env": "^7.11.0",
"@babel/preset-typescript": "^7.10.4",
"@jest-decorated/core": "^0.1.1",
"@types/jest": "^27.0.2",
"@types/node": "^14.0.23",
"axios": "^0.21.1",
"babel-jest": "^27.3.1",
"expect-playwright": "^0.2.5",
"jest": "^27.3.1",
"jest-allure": "^0.1.3",
"jest-circus": "^27.3.1",
"jest-circus-allure-environment": "^0.13.3",
"playwright": "^1.16.2"
},
Hey π
I would like to share a test suite so that I do not need to create the same one with different dependencies, but it does not seem to be 'possible' since it does not run the constructor.
The base class that contains the tests
Using inheritance:
export class CreateTaskShould extends BaseCreateTask {
public constructor() {
const fakeRepo = new FakeTaskRepository()
const db = new TestDatabaseClient(fakeRepo)
super(db, fakeRepo)
}
}
results in dependencies being undefined because the constructor is never ran. Now another solution would have been to make "BaseCreateTask" abstract but then the decorators won't work.
Hi,
When trying to import the module like this:
import { BeforeAll, AfterAll } from "@jest-decorated/core";
I'm getting the following error:
Could not find a declaration file for module '@jest-decorated/core'. '/workspace/node_modules/@jest-decorated/core/dist/index.umd.js' implicitly has an 'any' type.
Importing into global scope, i.e.
import "@jest-decorated/core/globals";
works fine, but I'd like to keep the global scope as clean as possible.
@jest-decorated/core version: 0.0.19
TypeScript version: 4.1.3
tsconfig:
{
"compilerOptions": {
"strict": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"target": "ES6",
"moduleResolution": "node"
},
"include": [
"src/**/*"
]
}
Could you please advise? Thanks.
βοΈ Important announcement: Greenkeeper will be saying goodbye π and passing the torch to Snyk on June 3rd, 2020! Find out how to migrate to Snyk and more at greenkeeper.io
5.4.0
to 5.5.0
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
@testing-library/jest-dom is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 3 commits.
025c81d
docs: add cloud-walker as a contributor (#231)
840414f
feat: Add toHaveDisplayValue()
matcher (#223)
779448f
docs: add jonrimmer as a contributor (#229)
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.