TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ravindra P
NA
4
468
Unit Test Simple Class with Parameter Constructor
May 15 2020 1:53 AM
Hi Team,
I have simple class with parameter construnctor and statics methods.
Class test {
static add( num1 , num2) : number
{
retrun num1 + num2;
}
constructor(_id: number , _id2: number , _name: string , _endDate: Date ) {
this.rid = _id;
this.id2= _id2;
this.name= _name;
this.endDate = _endDate }
}
How can write unit test with jasmin karma i tried but getting issue while using method
describe('add test ' , () => {
it('should add numbers ', () => {
const result = model.add(1,2);
expect(result).toBe(3);
});
});
Issue : "Property 'add' is a static member of type 'test'"
Reply
Answers (
3
)
How to pass data child component to parent component
Other Component call after complet method of first component