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

ULL-ESIT-INF-DSI-2526 / theory-examples / 25054461771

28 Apr 2026 01:03PM UTC coverage: 28.571% (-71.4%) from 100.0%
25054461771

push

github

esegredo
Actions with supertest

4 of 22 branches covered (18.18%)

Branch coverage included in aggregate %.

38 of 125 new or added lines in 8 files covered. (30.4%)

38 of 125 relevant lines covered (30.4%)

0.44 hits per line

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

40.0
/src/models/note.ts
1
import { Document, Schema, model } from "mongoose";
2
import { UserDocumentInterface } from "./user.js";
3

4
interface NoteDocumentInterface extends Document {
5
  title: string;
6
  body: string;
7
  color?: "blue" | "green" | "red" | "yellow" | "magenta";
8
  owner: UserDocumentInterface;
9
}
10

11
const NoteSchema = new Schema<NoteDocumentInterface>({
1✔
12
  title: {
13
    type: String,
14
    unique: true,
15
    required: true,
16
    trim: true,
17
    validate: (value: string) => {
NEW
18
      if (!value.match(/^[A-Z]/)) {
×
NEW
19
        throw new Error("Note title must start with a capital letter");
×
20
      }
21
    },
22
  },
23
  body: {
24
    type: String,
25
    required: true,
26
    trim: true,
27
  },
28
  color: {
29
    type: String,
30
    trim: true,
31
    default: "yellow",
32
    enum: ["blue", "green", "red", "yellow", "magenta"],
33
  },
34
  owner: {
35
    type: Schema.Types.ObjectId,
36
    required: true,
37
    ref: "User",
38
  },
39
});
40

41
export const Note = model<NoteDocumentInterface>("Note", NoteSchema);
1✔
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

© 2026 Coveralls, Inc