Skip to content

Playground for TP about TypeScript. Part of the Web Development course followed by students of Mines St Etienne, ISMIN - M2 Computer Science.

License

Notifications You must be signed in to change notification settings

inesbenamor/ismin-web-2020-tp1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Part of Web Development - ISMIN 2020

Course followed by students of Mines St Etienne, ISMIN - M2 Computer Science.

jest code style: prettier TypeScript Mines St Etienne

TP1: Introduction to TypeScript

📝 Goal

The goal is to discover TypeScript and its ecosystem by implementing:

  • 📙 A Book interface containing 3 string attributes:
    • title
    • author
    • date
  • 📚 A Bookshelf class that internally store books and have the following public functions:
    • addBook(book: Book)
    • getBook(name: string) returning a Book
    • getBooksOf(author: string) returning an array of Books
    • getAllBooks() returning an array of Books
    • getTotalNumberOfBooks() returning a number

To guide you and help you find out if everything is ✅ a test suite is available in ./Bookshelf.test.ts. These tests can be ran using Jest in command line or inside your IDE.

🚀 Getting Started

Open a terminal, go to the directory of this TP and run the following commands:

# This will install all needed dependencies
npm install

# This will run the tests once
npm run test

OR

# This will run the tests everytime a change is made in the source code
npm run test:watch

# This will build the source and put the transpiled code in `/dist` directory
npm run build

That's it! You can code!

🛰 Extra:

  • Handle the date attribut as a date and not a string
  • Add a test, and a function getBooksPublishedBefore(aDate: string | Date) returning an array of Books

About

Playground for TP about TypeScript. Part of the Web Development course followed by students of Mines St Etienne, ISMIN - M2 Computer Science.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published