• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bahmutov / code-coverage-vue-example / d0af4365-4262-4908-a0dc-aa883c776f0f

pending completion
d0af4365-4262-4908-a0dc-aa883c776f0f

Pull #306

circleci

web-flow
Update dependency start-server-and-test to v1.15.4
Pull Request #306: Update dependency start-server-and-test to v1.15.4

0 of 2 branches covered (0.0%)

Branch coverage included in aggregate %.

5 of 12 relevant lines covered (41.67%)

0.83 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

20.0
/src/components/TodoList.vue
1
<script>
2
import BaseInputText from "./BaseInputText.vue";
3
import TodoListItem from "./TodoListItem.vue";
4
let nextTodoId = 1;
2✔
5
export default {
6
  components: {
7
    BaseInputText,
8
    TodoListItem
9
  },
10
  data() {
11
    return {
2✔
12
      newTodoText: "",
13
      // empty list at first, each item like with "id" and "text"
14
      todos: []
15
    };
16
  },
17
  methods: {
18
    addTodo() {
19
      const trimmedText = this.newTodoText.trim();
×
20
      if (trimmedText) {
×
21
        this.todos.push({
×
22
          id: nextTodoId++,
23
          text: trimmedText
24
        });
25
        this.newTodoText = "";
×
26
      }
27
    },
28
    removeTodo(idToRemove) {
29
      this.todos = this.todos.filter(todo => {
×
30
        return todo.id !== idToRemove;
×
31
      });
32
    }
33
  }
34
};
35
</script>
36

37
<template>
38
  <div>
39
    <BaseInputText
40
      data-cy="input"
41
      v-model="newTodoText"
42
      placeholder="New todo"
43
      @keydown.enter="addTodo"
44
    />
45
    <ul v-if="todos.length">
46
      <TodoListItem v-for="todo in todos" :key="todo.id" :todo="todo" @remove="removeTodo"/>
47
    </ul>
48
    <p v-else>Nothing left in the list. Add a new todo in the input above.</p>
49
  </div>
50
</template>
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc