Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javascript and Typescript tests #519

Merged
merged 2 commits into from
May 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions tests/data/javascript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// 33 lines, 14 code, 11 comments, 8 blanks

/*
* /* Nested comment
* // single line comment
* */

/*

function add(a, b) {
return a + b;
}
*/

class Rectangle {
constructor(width, height) {
this.width = width;
this.height = height;
}

get area() {
return this.calcArea();
}

calcArea() {
return this.width * this.height;
}
}

let rect = new Rectangle(20, 20);
console.log(rect.area); // 400

// Comment
33 changes: 33 additions & 0 deletions tests/data/typescript.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// 33 lines, 19 code, 7 comments, 7 blanks
/*

Multi-line comment with blanks


*
*/
// Comment
class Person {
#age: number;
#name: string; // end of line comment
#height: number;

constructor(age: number, name: string, height: number) {
this.#age = age;
this.#name = name;
this.#height = height;
}
}

let main = () => {
// Comment with quote "
let person = new Person(
5,
`Phill

the giant`,
7
);
};

main();