This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface Address { | |
| street: string, | |
| postalCode: string | |
| } | |
| interface User { | |
| name: string, | |
| address: Address, | |
| age: number | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function questionFetch() { | |
| console.log("1"); | |
| fetch("https://jsonplaceholder.typicode.com/todos/1") | |
| .then((response) => { | |
| console.log("2"); | |
| return response.json(); | |
| }) | |
| .then((data) => { | |
| console.log("3"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function fetchWithThenCatch() { | |
| fetch("https://api.coinlore.net/api/tickers/") | |
| .then((r) => r.json()) | |
| .then((json) => { | |
| for (let i = 0; i < 3; i++) { | |
| console.log('A - ', json.data[i].name); | |
| } | |
| }) | |
| .catch((error) => console.log("A - Erreur: ", error)) | |
| .finally(() => console.log("A - Finally")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // https://www.perdu.com/ | |
| // Ajouter jquery à la page | |
| var js = document.createElement('script'); | |
| js.src = 'https://releases.jquery.com/git/jquery-git.js'; | |
| document.getElementsByTagName('head')[0].appendChild(js); | |
| // Attendre un minimum que le script load | |
| // Manipulations | |
| $('h1').text('Toujours perdu?') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ... | |
| @SpringBootApplication | |
| @PropertySource("classpath:cors.properties") | |
| @PropertySource("classpath:firebase.properties") | |
| public class ChatApplication { | |
| // ... | |
| @PostConstruct |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.inf5190.chat.messages; | |
| import static org.assertj.core.api.Assertions.assertThat; | |
| import java.net.HttpCookie; | |
| import java.util.concurrent.ExecutionException; | |
| import org.junit.jupiter.api.AfterEach; | |
| import org.junit.jupiter.api.BeforeAll; | |
| import org.junit.jupiter.api.BeforeEach; | |
| import org.junit.jupiter.api.Test; | |
| import org.springframework.beans.factory.annotation.Autowired; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.inf5190.chat.auth; | |
| import static org.assertj.core.api.Assertions.assertThat; | |
| import static org.mockito.Mockito.times; | |
| import static org.mockito.Mockito.verify; | |
| import static org.mockito.Mockito.when; | |
| import java.util.concurrent.ExecutionException; | |
| import org.junit.jupiter.api.BeforeEach; | |
| import org.junit.jupiter.api.Test; | |
| import org.mockito.Mock; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.inf5190.chat; | |
| import java.io.FileInputStream; | |
| import java.io.IOException; | |
| import java.util.Arrays; | |
| import javax.annotation.PostConstruct; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { ComponentFixture, TestBed } from "@angular/core/testing"; | |
| import { ReactiveFormsModule } from "@angular/forms"; | |
| import { TestHelper } from "src/app/test/test-helper"; | |
| import { LoginFormComponent } from "./login-form.component"; | |
| import { MatFormFieldModule } from "@angular/material/form-field"; | |
| import { MatInputModule } from "@angular/material/input"; | |
| import { NoopAnimationsModule } from "@angular/platform-browser/animations"; | |
| describe("LoginFormComponent", () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { ComponentFixture } from '@angular/core/testing'; | |
| import { By } from '@angular/platform-browser'; | |
| /** | |
| * Classe de test qui aide à aller chercher des éléments HTML de la page. | |
| * | |
| * Elle utilise l'attribut `data-testid=` pour sélectionner les éléments. | |
| * Par exemple: | |
| * <input | |
| * name="username" |
NewerOlder