Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Auto select workspace proxy based on lowest latency#7515

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Emyrk merged 16 commits intomainfromstevenmasley/proxy_latency_pick
May 22, 2023
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
16 commits
Select commitHold shift + click to select a range
159538c
WIP: Proxy auto select and user selection state
EmyrkMay 11, 2023
1305931
chore: Auto select based on latency
EmyrkMay 12, 2023
d1c9f3f
Add extra test for unknown latencies
EmyrkMay 12, 2023
c739f24
Move arg inside the funcs
EmyrkMay 12, 2023
ae26777
Fmt
EmyrkMay 12, 2023
523e492
Duplicate import
EmyrkMay 12, 2023
877c0c9
PR feedback
EmyrkMay 12, 2023
8d26643
Merge remote-tracking branch 'origin/main' into stevenmasley/proxy_la…
EmyrkMay 12, 2023
5c534fa
Refactor
EmyrkMay 12, 2023
a3703e1
Fix useEffect dep
EmyrkMay 18, 2023
c210e8d
Merge remote-tracking branch 'origin/main' into stevenmasley/proxy_la…
EmyrkMay 18, 2023
a358258
Fix deps comment
EmyrkMay 18, 2023
ec860c3
Remove comment
EmyrkMay 22, 2023
3197eb1
Merge remote-tracking branch 'origin/main' into stevenmasley/proxy_la…
EmyrkMay 22, 2023
ebb6a76
Mock the hook with a hook
EmyrkMay 22, 2023
549093e
Remove unused dep
EmyrkMay 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Fmt
  • Loading branch information
@Emyrk
Emyrk committedMay 12, 2023
commitae2677736518a83e7f8b590dfd387a19f355e23b
5 changes: 4 additions & 1 deletionsite/src/testHelpers/entities.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1374,7 +1374,10 @@ export const MockEntitlementsWithScheduling: TypesGen.Entitlements = {
}),
}

export const MockExperiments: TypesGen.Experiment[] = ["workspace_actions", "moons"]
export const MockExperiments: TypesGen.Experiment[] = [
"workspace_actions",
"moons",
]

export const MockAuditLog: TypesGen.AuditLog = {
id: "fbd2116a-8961-4954-87ae-e4575bd29ce0",
Expand Down
24 changes: 12 additions & 12 deletionssite/src/testHelpers/localstorage.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
export const localStorageMock = () => {
const store = {} as Record<string, string>;
const store = {} as Record<string, string>

return {
getItem: (key: string):string =>{
return store[key];
getItem: (key: string):string =>{
return store[key]
},
setItem: (key:string, value:string)=> {
store[key] = value;
setItem: (key:string, value:string)=> {
store[key] = value
},
clear: ()=> {
clear: ()=> {
Object.keys(store).forEach((key) => {
delete store[key];
});
delete store[key]
})
},
removeItem: (key: string) => {
delete store[key]
},
removeItem: (key:string) => {
delete store[key];
}
}
}

Object.defineProperty(window, "localStorage", { value: localStorageMock() });
Object.defineProperty(window, "localStorage", { value: localStorageMock() })
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Since this is being executed when the module is imported, maybe can be interesting to move all this code into the test setup file and mock it globally. We are doing that for a few default window interfaces.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

maybe, I just wanted to avoid putting things in the global if my test was the only one using it atm.


[8]ページ先頭

©2009-2025 Movatter.jp