princesseuh / astro-component-tester Goto Github PK
View Code? Open in Web Editor NEWUtility to test Astro components
Utility to test Astro components
While the project currently does work on all versions of Astro, some features are not supported. For instance, it is not possible to add integrations.
WARN Issues with peer dependencies found
.
└─┬ astro-component-tester 0.6.0
└── ✕ unmet peer astro@^1.0.0-rc.1: found 3.3.4
Dear Contributors,
I hope this message finds you well. I am writing to propose an enhancement to the astro-component-tester
utility, which I have found to be an invaluable tool in the development of Astro components. The utility's ability to create an isolated testing environment is commendable; however, I have encountered a limitation that I believe could be addressed to further refine the testing experience.
The current implementation of astro-component-tester
constructs an isolated environment for building components, which, while effective for most scenarios, does not account for context-specific variables such as Astro.request
. This limitation becomes apparent when attempting to test components that rely on such context for their functionality. The absence of a mocking mechanism for these variables means that certain component behaviours cannot be accurately tested or replicated.
To enhance the utility's testing capabilities, I propose the introduction of a mocking framework that allows developers to simulate context-specific variables. This would enable a more comprehensive testing environment that can mimic the various states and conditions a component might encounter in a production setting.
A potential approach to this could involve:
getComponentOutput
function to accept an additional parameter for context mocks.The inclusion of a mocking feature would provide several benefits:
astro-component-tester
with other testing frameworks that offer similar mocking capabilities, thereby enhancing its utility.I am keen to hear your thoughts on this proposal and would be delighted to contribute to the implementation should there be consensus on its potential value.
Thank you for considering this enhancement. I look forward to a fruitful discussion.
Best regards,
yihong1120
This is missing documentation at the moment. I'd like to provide something similar to the Docs.md file available in my other projects, ex: https://github.com/Princesseuh/astro-eleventy-img/blob/main/Docs.md
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.