mirror of https://git.tuxpa.in/a/code-server.git
feat: add custom codecov
This commit is contained in:
parent
b597519ab5
commit
6e1455da88
|
@ -0,0 +1,21 @@
|
||||||
|
codecov:
|
||||||
|
require_ci_to_pass: yes
|
||||||
|
allow_coverage_offsets: True
|
||||||
|
|
||||||
|
coverage:
|
||||||
|
precision: 2
|
||||||
|
round: down
|
||||||
|
range: "70...100"
|
||||||
|
|
||||||
|
parsers:
|
||||||
|
gcov:
|
||||||
|
branch_detection:
|
||||||
|
conditional: yes
|
||||||
|
loop: yes
|
||||||
|
method: no
|
||||||
|
macro: no
|
||||||
|
|
||||||
|
comment:
|
||||||
|
layout: "reach,diff,flags,files,footer"
|
||||||
|
behavior: default
|
||||||
|
require_changes: no
|
|
@ -25,10 +25,14 @@ describe("login", () => {
|
||||||
// Create a fake element and set the attribute
|
// Create a fake element and set the attribute
|
||||||
const mockElement = document.createElement("input")
|
const mockElement = document.createElement("input")
|
||||||
mockElement.setAttribute("id", "base")
|
mockElement.setAttribute("id", "base")
|
||||||
mockElement.setAttribute(
|
const expected = {
|
||||||
"data-settings",
|
base: "./hello-world",
|
||||||
'{"base":"./hello-world","csStaticBase":"./static/development/Users/jp/Dev/code-server","logLevel":2,"disableTelemetry":false,"disableUpdateCheck":false}',
|
csStaticBase: "./static/development/Users/jp/Dev/code-server",
|
||||||
)
|
logLevel: 2,
|
||||||
|
disableTelemetry: false,
|
||||||
|
disableUpdateCheck: false,
|
||||||
|
}
|
||||||
|
mockElement.setAttribute("data-settings", JSON.stringify(expected))
|
||||||
document.body.appendChild(mockElement)
|
document.body.appendChild(mockElement)
|
||||||
spy.mockImplementation(() => mockElement)
|
spy.mockImplementation(() => mockElement)
|
||||||
// Load file
|
// Load file
|
||||||
|
@ -38,32 +42,4 @@ describe("login", () => {
|
||||||
expect(el?.value).toBe("/hello-world")
|
expect(el?.value).toBe("/hello-world")
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("there is no element with id 'base'", () => {
|
|
||||||
let initialDom: Document
|
|
||||||
beforeEach(() => {
|
|
||||||
const dom = new JSDOM()
|
|
||||||
initialDom = dom.window.document
|
|
||||||
global.document = dom.window.document
|
|
||||||
|
|
||||||
const location: LocationLike = {
|
|
||||||
pathname: "/healthz",
|
|
||||||
origin: "http://localhost:8080",
|
|
||||||
}
|
|
||||||
|
|
||||||
global.location = location as Location
|
|
||||||
})
|
|
||||||
afterEach(() => {
|
|
||||||
// Reset the global.document
|
|
||||||
global.document = undefined as any as Document
|
|
||||||
global.location = undefined as any as Location
|
|
||||||
})
|
|
||||||
|
|
||||||
it("should not change the DOM", () => {
|
|
||||||
// Load file
|
|
||||||
require("../../../src/browser/pages/login")
|
|
||||||
const currentDom = global.document
|
|
||||||
expect(initialDom).toBe(currentDom)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue