Skip to content

Commit

Permalink
setup TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
santakadev committed Apr 16, 2021
1 parent 7119097 commit 2634a94
Show file tree
Hide file tree
Showing 7 changed files with 816 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
presets: [
['@babel/preset-env', {targets: {node: 'current'}}],
'@babel/preset-typescript',
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
"test": "jest"
},
"devDependencies": {
"jest": "^26.6.3"
"@babel/core": "^7.13.15",
"@babel/preset-env": "^7.13.15",
"@babel/preset-typescript": "^7.13.0",
"@types/jest": "^26.0.22",
"babel-jest": "^26.6.3",
"jest": "^26.6.3",
"typescript": "^4.2.4"
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
interface Course {
title: string;
}

function courseTitle(course: Course) {
return course.title;
}

module.exports = courseTitle;

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const courseTitle = require('../src');

test('gets the course title', () => {
const course = {title: 'Refactoring'}
expect(courseTitle(course)).toBe('Refactoring')
});
807 changes: 788 additions & 19 deletions examples/typescript/ts-step_shotgun_surgery-01_base/yarn.lock

Large diffs are not rendered by default.

0 comments on commit 2634a94

Please sign in to comment.