Я сделал небольшой проект «Заметки» и сейчас пытаюсь протестировать его с помощью Jasmine. Но так как это мой первый скрипт, использующий стиль модуля и имитацию приватных функций, я не могу понять, как я могу проверить бизнес-логику моего скрипта, так как Жасмин вообще не видит мои функции стрелок. Пожалуйста, помогите мне начать мои тесты.

// eslint-disable-next-line func-names const NotesList = ((function () { const NOTE_TITLE = 'notesList'; const initNotesList = () ={amp}gt; { if (localStorage.getItem(NOTE_TITLE)) { return JSON.parse(localStorage.getItem(NOTE_TITLE)); } return []; }; let notesList = initNotesList(); const saveData = (data) ={amp}gt; { notesList = [...data]; localStorage.setItem(NOTE_TITLE, JSON.stringify(notesList)); }; const addNote = (note) ={amp}gt; { if (notesList.includes(note)) { return { done: false, error: 'The note is in the notes list already', }; } saveData([...notesList, note]); return { done: true, }; }; const removeNote = (note) ={amp}gt; { const filteredNotesList = notesList.filter((item) ={amp}gt; item !== note); if (filteredNotesList.length === notesList.length) { return { done: false, error: 'Note doesn't exist', }; } saveData(filteredNotesList); return { done: true }; }; return { getNotesList() { return notesList; }, addItem(item) { return addNote(item); }, removeItem(item) { return removeNote(item); }, }; })()); const STYLES = { show: 'd-block', }; const UI = { noteValue: document.querySelector('#note-value'), addNote: document.querySelector('#add-note'), removeNote: document.querySelector('#remove-note'), errorMessage: document.querySelector('#error-message'), list: document.querySelector('#list'), renderNotesList() { this.clearNotesList(); NotesList.getNotesList().forEach((item) ={amp}gt; { const li = document.createElement('li'); li.innerText = item; this.list.append(li); }); }, clearNotesList() { this.list.innerText = ''; }, handleNotesListResponse(result) { if (result.done) { this.noteValue.value = ''; this.errorMessage.classList.remove(STYLES.show); this.renderNotesList(); } else { this.errorMessage.innerText = result.error; this.errorMessage.classList.add(STYLES.show); } }, }; UI.addNote.addEventListener('click', (event) ={amp}gt; { event.preventDefault(); const result = NotesList.addItem(UI.noteValue.value); UI.handleNotesListResponse(result); }); UI.removeNote.addEventListener('click', (event) ={amp}gt; { event.preventDefault(); const result = NotesList.removeItem(UI.noteValue.value); UI.handleNotesListResponse(result); }); UI.renderNotesList(); 
 body{font-family:"Roboto Condensed",sans-serif;font-size:16px}header{background:none}.nav-link{font-size:20px}.container{max-width:1200px;background-image:url(../images/blue-snow.png)}.container-header{max-width:1200px}.container-footer{max-width:1200px}footer li{display:inline;padding-right:5px;padding-bottom:5px}ul li a :hover{transform:rotate(1turn);transition:0.5s ease-in}html{scroll-behavior:smooth} 
 {amp}lt;!DOCTYPE html{amp}gt; {amp}lt;html lang="en"{amp}gt; {amp}lt;head{amp}gt; {amp}lt;meta charset="UTF-8"{amp}gt; {amp}lt;meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"{amp}gt; {amp}lt;link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"{amp}gt; {amp}lt;link href="https://fonts.googleapis.com/css?family=Roboto Condensed{amp}amp;display=swap" rel="stylesheet"{amp}gt; {amp}lt;link rel="stylesheet" type="text/css" href="../dist/style.css"/{amp}gt; {amp}lt;title{amp}gt;Homework 1{amp}lt;/title{amp}gt; {amp}lt;/head{amp}gt; {amp}lt;body{amp}gt; {amp}lt;div class="container-header mx-auto"{amp}gt; {amp}lt;header{amp}gt; {amp}lt;nav class="navbar navbar-expand-lg navbar navbar-light bg-light"{amp}gt; {amp}lt;a class="navbar-brand pr-4" href="https://github.com/TrekFuel/home_tasks_FE-2" target="_blank"{amp}gt;{amp}lt;img src="../images/github-logo-header-image.png" alt="GitHub" title="GitHub" width="40" height="40"/{amp}gt;{amp}lt;/a{amp}gt; {amp}lt;button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"{amp}gt; {amp}lt;span class="navbar-toggler-icon"{amp}gt;{amp}lt;/span{amp}gt; {amp}lt;/button{amp}gt; {amp}lt;div class="collapse navbar-collapse" id="navbarSupportedContent"{amp}gt; {amp}lt;ul class="navbar-nav mr-auto"{amp}gt; {amp}lt;li class="nav-item active pr-5"{amp}gt; {amp}lt;a class="nav-link" href="homework-3.html"{amp}gt;Home Tasks (to the previous page){amp}lt;span class="sr-only"{amp}gt;{amp}lt;/span{amp}gt;{amp}lt;/a{amp}gt; {amp}lt;/li{amp}gt; {amp}lt;li class="nav-item active"{amp}gt; {amp}lt;a class="nav-link" href="#2"{amp}gt;Contacts{amp}lt;span class="sr-only"{amp}gt;{amp}lt;/span{amp}gt;{amp}lt;/a{amp}gt; {amp}lt;/li{amp}gt; {amp}lt;/ul{amp}gt; {amp}lt;/div{amp}gt; {amp}lt;/nav{amp}gt; {amp}lt;/header{amp}gt; {amp}lt;/div{amp}gt; {amp}lt;div class="container mx-auto d-flex"{amp}gt; {amp}lt;main{amp}gt; {amp}lt;div class="row mt-5 mb-5 ml-3 mr-3"{amp}gt; {amp}lt;div class="col"{amp}gt; {amp}lt;h1 class="text-center mb-4"{amp}gt;Notes{amp}lt;/h1{amp}gt; {amp}lt;div class="input-group input-group-lg mx-auto mt-5 mb-5"{amp}gt; {amp}lt;input type="text" class="form-control" id="note-value" name="note-value" value="" placeholder="Note" aria-label="Note" aria-describedby="button-addon4 inputGroup-sizing-lg"{amp}gt; {amp}lt;div class="input-group-append" id="button-addon4"{amp}gt; {amp}lt;button class="btn btn-outline-secondary" id="add-note" type="button"{amp}gt;Add note {amp}lt;/button{amp}gt; {amp}lt;button class="btn btn-outline-secondary" id="remove-note" type="button"{amp}gt;Remove note {amp}lt;/button{amp}gt; {amp}lt;/div{amp}gt; {amp}lt;/div{amp}gt; {amp}lt;div class="alert alert-danger d-none" id="error-message" role="alert"{amp}gt;{amp}lt;/div{amp}gt; {amp}lt;/div{amp}gt; {amp}lt;/div{amp}gt; {amp}lt;div class="row mt-3 mb-3"{amp}gt; {amp}lt;div class="col"{amp}gt; {amp}lt;ul id="list"{amp}gt;{amp}lt;/ul{amp}gt; {amp}lt;/div{amp}gt; {amp}lt;/div{amp}gt; {amp}lt;/main{amp}gt; {amp}lt;/div{amp}gt; {amp}lt;div class="container-footer mx-auto"{amp}gt; {amp}lt;footer{amp}gt; {amp}lt;a name="2"{amp}gt;{amp}lt;/a{amp}gt; {amp}lt;div class="card text-center"{amp}gt; {amp}lt;div class="card-header"{amp}gt; {amp}lt;a name="7"{amp}gt;{amp}lt;/a{amp}gt; {amp}lt;h3{amp}gt;Contacts{amp}lt;/h3{amp}gt; {amp}lt;/div{amp}gt; {amp}lt;div class="card-footer text-center"{amp}gt; {amp}lt;ul class="list-unstyled p-2"{amp}gt; {amp}lt;li{amp}gt; {amp}lt;a href="https://vk.com/bolotinnikita" target="_blank"{amp}gt; {amp}lt;img src="../images/vk-logo.png" width="30" height="30" alt="ВК" title="ВК"/{amp}gt;{amp}lt;/a{amp}gt; {amp}lt;/li{amp}gt; {amp}lt;li{amp}gt; {amp}lt;a href="https://twitter.com/bolotinnick" target="_blank"{amp}gt; {amp}lt;img src="../images/twitter-logo.png" width="30" height="30" alt="Twitter" title="Twitter"/{amp}gt;{amp}lt;/a{amp}gt; {amp}lt;/li{amp}gt; {amp}lt;li{amp}gt; {amp}lt;a href="https://www.linkedin.com/in/bolotinnick/" target="_blank"{amp}gt; {amp}lt;img src="../images/linkedin-logo.png" width="30" height="30" alt="LinkedIn" title="LinkedIn"/{amp}gt;{amp}lt;/a{amp}gt; {amp}lt;/li{amp}gt; {amp}lt;li{amp}gt; {amp}lt;a href="https://github.com/TrekFuel" target="_blank"{amp}gt; {amp}lt;img src="../images/github-logo.png" width="30" height="30" alt="GitHub" title="GitHub"/{amp}gt;{amp}lt;/a{amp}gt; {amp}lt;/li{amp}gt; {amp}lt;li{amp}gt; {amp}lt;a href="https://www.instagram.com/bolotinnick/" target="_blank"{amp}gt; {amp}lt;img src="../images/instagram-logo.png" width="30" height="30" alt="Instagram" title="Instagram"/{amp}gt;{amp}lt;/a{amp}gt; {amp}lt;/li{amp}gt; {amp}lt;li{amp}gt; {amp}lt;a href="mailto:ridge96@yandex.ru?subject=website"{amp}gt; {amp}lt;img src="../images/email-logo.png" width="30" height="30" alt="Email" title="Email"/{amp}gt;{amp}lt;/a{amp}gt; {amp}lt;/li{amp}gt; {amp}lt;li{amp}gt; {amp}lt;a href="https://t.me/bolotinnick" target="_blank"{amp}gt; {amp}lt;img src="../images/telegram-logo.png" width="30" height="30" alt="Telegram" title="Telegram"/{amp}gt;{amp}lt;/a{amp}gt; {amp}lt;/li{amp}gt; {amp}lt;li{amp}gt; {amp}lt;a href="skype:nick-spinner96?add"{amp}gt; {amp}lt;img src="../images/skype-logo.png" width="30" height="30" alt="Skype" title="Skype"/{amp}gt;{amp}lt;/a{amp}gt; {amp}lt;/li{amp}gt; {amp}lt;li{amp}gt; {amp}lt;a href="viber://chat?number= 375291328633"{amp}gt; {amp}lt;img src="../images/viber-logo.png" width="30" height="30" alt="Viber" title="Viber"/{amp}gt;{amp}lt;/a{amp}gt; {amp}lt;/li{amp}gt; {amp}lt;li{amp}gt; {amp}lt;a href="https://wa.me/375291328633" target="_blank"{amp}gt; {amp}lt;img src="../images/whatsapp-logo.png" width="30" height="30" alt="WhatsApp" title="WhatsApp"/{amp}gt;{amp}lt;/a{amp}gt; {amp}lt;/li{amp}gt; {amp}lt;/ul{amp}gt; {amp}lt;div class="btn btn-info mb-2"{amp}gt;Bolotin Nikita {amp}amp;copy;, 2019-2020 {amp}lt;br{amp}gt; FE-2 Courses {amp}lt;/div{amp}gt; {amp}lt;/div{amp}gt; {amp}lt;div class="text-left m-2"{amp}gt; {amp}lt;a href="#top" class="btn btn-primary" id="btn"{amp}gt;To the top {amp}amp;uarr;{amp}lt;/a{amp}gt; {amp}lt;/div{amp}gt; {amp}lt;/div{amp}gt; {amp}lt;/footer{amp}gt; {amp}lt;/div{amp}gt; {amp}lt;script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X 965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH 8abtTE1Pi6jizo" crossorigin="anonymous"{amp}gt;{amp}lt;/script{amp}gt; {amp}lt;script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"{amp}gt;{amp}lt;/script{amp}gt; {amp}lt;script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM B07jRM" crossorigin="anonymous"{amp}gt;{amp}lt;/script{amp}gt; {amp}lt;script src="../js/notes(hw-3).js"{amp}gt;{amp}lt;/script{amp}gt; {amp}lt;/body{amp}gt; {amp}lt;/html{amp}gt; 

 // eslint-disable-next-line no-undef describe('notes(hw-3).js -{amp}gt; initNotesList', () ={amp}gt; { // eslint-disable-next-line no-undef it('should return Object from the LocalStorage in case there are items'   ' there, otherwise should return an empty array', () ={amp}gt; { }); }); 

Никита Болотин

новый участник этого сайта. Будьте внимательны, спрашивая разъяснения, комментируя и отвечая. Проверьте наш

Правила поведения

,