Open mike03081972 opened 6 years ago
Happy to help maintain a .d.ts
- mind sending a PR with how this is configured within a typical repo?
Hi,
I'm pretty new in Javascript/typescript. I don't know how to write this file but whenI have some times, I will try to investigate it.
Some infos when I try to use it :
I will receive this message from WebStorm
The code looks like this :
import {mocha} from 'approvals';
mocha();
describe('When running some tests', function () {
it('should be able to use Approvals', function () {
let value = 'HELLO WORLD';
this.verify(value);
});
});
Thanks,
2018-04-29 21:53 GMT+02:00 Jason Jarrett notifications@github.com:
Happy to help maintain a .d.ts - mind sending a PR with how this is configured within a typical repo?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/approvals/Approvals.NodeJS/issues/78#issuecomment-385276830, or mute the thread https://github.com/notifications/unsubscribe-auth/AWLkMVj_vwn34yDbtAufwSrS5w8Fw2tuks5tthpLgaJpZM4TjmDM .
Hi,
You will find attached an example project that works under typescript. The .d.ts files is located in the folder typings
Best regards
@staxmanade wouldn't mind contributing to the repository with typings and their documentation. 😄
@labsvisual Please do - would love some pull requests and help...
@staxmanade on it!
Would it be an option to change the project to a typescript project? I'd be interested in submitting a PR for that. It would still work for JS users.
@DanKaplanSES I would be open to this. @isidore and I have had a few weekend pairing sessions over the summer - perhaps something we could all jump into in the coming months and work on together.
I'm down. Let me know.
Hi Jason!
I'm helping someone in the Obsidian plugin community to start writing approval tests for some typescript-based code...
I've pointed them at this issue, to see if the attachments help... Will report here how we get on...
Thanks Clare :)
@mike03081972 I managed to get your example project working.
However, the issue I had before is that I cannot import functions from other files in the project into the test.specs.ts
file. If I want to test myFunc
from utils.ts
, for example, I add import {myFunc} from '../src/utils'
, but I get the following error:
It feels like there should be a way around this. Surely I should be able to import functions into the test file.
EDIT: I can import local functions from other files. The issue seems to arise from using 3rd-party libs in those other files
EDIT: I can import local functions from other files. The issue seems to arise from using 3rd-party libs in those other files
I wonder whether it's worth starting from the other end, from the starter project - which does already import a source file from another location... And seeing if you can add to that the use of a 3rd-party lib.
https://github.com/approvals/ApprovalTests.js.StarterProject
Is it possible to publish also the declaration file for module 'approvals' (.d.ts)
=> npm install @types/approvals` => yarn add @types/approvals