Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
Coder
code-server
提交
cb65590b
C
code-server
项目概览
镜像
/
Coder
/
code-server
2022-09-21 03:15:05同步失败
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
code-server
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
cb65590b
编写于
4月 21, 2021
作者:
J
Joe Previte
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: move tmpdir into src/node/constants
上级
cc99fddf
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
20 addition
and
13 deletion
+20
-13
src/node/constants.ts
src/node/constants.ts
+2
-0
src/node/socket.ts
src/node/socket.ts
+2
-1
src/node/util.ts
src/node/util.ts
+0
-2
test/e2e/models/CodeServer.ts
test/e2e/models/CodeServer.ts
+7
-7
test/e2e/terminal.test.ts
test/e2e/terminal.test.ts
+4
-0
test/unit/cli.test.ts
test/unit/cli.test.ts
+2
-1
test/unit/socket.test.ts
test/unit/socket.test.ts
+2
-1
test/unit/update.test.ts
test/unit/update.test.ts
+1
-1
未找到文件。
src/node/constants.ts
浏览文件 @
cb65590b
import
{
logger
}
from
"
@coder/logger
"
import
{
JSONSchemaForNPMPackageJsonFiles
}
from
"
@schemastore/package
"
import
*
as
os
from
"
os
"
import
*
as
path
from
"
path
"
export
function
getPackageJson
(
relativePath
:
string
):
JSONSchemaForNPMPackageJsonFiles
{
...
...
@@ -18,3 +19,4 @@ const pkg = getPackageJson("../../package.json")
export
const
version
=
pkg
.
version
||
"
development
"
export
const
commit
=
pkg
.
commit
||
"
development
"
export
const
rootPath
=
path
.
resolve
(
__dirname
,
"
../..
"
)
export
const
tmpdir
=
path
.
join
(
os
.
tmpdir
(),
"
code-server
"
)
src/node/socket.ts
浏览文件 @
cb65590b
...
...
@@ -4,7 +4,8 @@ import * as path from "path"
import
*
as
tls
from
"
tls
"
import
{
Emitter
}
from
"
../common/emitter
"
import
{
generateUuid
}
from
"
../common/util
"
import
{
canConnect
,
tmpdir
}
from
"
./util
"
import
{
tmpdir
}
from
"
./constants
"
import
{
canConnect
}
from
"
./util
"
/**
* Provides a way to proxy a TLS socket. Can be used when you need to pass a
...
...
src/node/util.ts
浏览文件 @
cb65590b
...
...
@@ -8,8 +8,6 @@ import * as path from "path"
import
*
as
util
from
"
util
"
import
xdgBasedir
from
"
xdg-basedir
"
export
const
tmpdir
=
path
.
join
(
os
.
tmpdir
(),
"
code-server
"
)
interface
Paths
{
data
:
string
config
:
string
...
...
test/e2e/models/CodeServer.ts
浏览文件 @
cb65590b
...
...
@@ -16,23 +16,23 @@ export class CodeServer {
async
navigate
()
{
await
this
.
page
.
goto
(
CODE_SERVER_ADDRESS
,
{
waitUntil
:
"
networkidle
"
})
le
t
editorIsVisible
=
await
this
.
isEditorVisible
()
cons
t
editorIsVisible
=
await
this
.
isEditorVisible
()
let
reloadCount
=
0
// Occassionally code-server timeouts in Firefox
// we're not sure why
// but usually a reload or two fixes it
// TODO@jsjoeio @oxy look into Firefox reconnection/timeout issues
// TODO@jsjoeio sometimes it's 2 reloads, othertimes it's 9
// double-check this logic
while
(
!
editorIsVisible
)
{
reloadCount
+=
1
editorIsVisible
=
await
this
.
isEditorVisible
()
if
(
editorIsVisible
)
{
console
.
log
(
`Editor became visible after
${
reloadCount
}
reloads`
)
if
(
await
this
.
isEditorVisible
())
{
console
.
log
(
` Editor became visible after
${
reloadCount
}
reloads`
)
break
}
await
this
.
page
.
reload
({
waitUntil
:
"
networkidle
"
})
// When a reload happens, we want to wait for all resources to be
// loaded completely. Hence why we use that instead of DOMContentLoaded
// Read more: https://thisthat.dev/dom-content-loaded-vs-load/
await
this
.
page
.
reload
({
waitUntil
:
"
load
"
})
}
}
...
...
test/e2e/terminal.test.ts
浏览文件 @
cb65590b
...
...
@@ -29,6 +29,10 @@ test.describe("Integrated Terminal", () => {
})
test
(
"
should echo a string to a file
"
,
options
,
async
({
page
})
=>
{
// NOTE@jsjoeio
// We're not using tmpdir from src/node/constants
// because Playwright doesn't fully support ES modules from
// the erorrs I'm seeing
const
tmpFolderPath
=
fs
.
mkdtempSync
(
path
.
join
(
tmpdir
(),
"
code-server-test
"
))
const
tmpFile
=
`
${
tmpFolderPath
}${
path
.
sep
}${
testFileName
}
`
// Open terminal and type in value
...
...
test/unit/cli.test.ts
浏览文件 @
cb65590b
...
...
@@ -4,7 +4,8 @@ import * as net from "net"
import
*
as
os
from
"
os
"
import
*
as
path
from
"
path
"
import
{
Args
,
parse
,
setDefaults
,
shouldOpenInExistingInstance
}
from
"
../../src/node/cli
"
import
{
paths
,
tmpdir
}
from
"
../../src/node/util
"
import
{
tmpdir
}
from
"
../../src/node/constants
"
import
{
paths
}
from
"
../../src/node/util
"
type
Mutable
<
T
>
=
{
-
readonly
[
P
in
keyof
T
]:
T
[
P
]
...
...
test/unit/socket.test.ts
浏览文件 @
cb65590b
...
...
@@ -4,8 +4,9 @@ import * as net from "net"
import
*
as
path
from
"
path
"
import
*
as
tls
from
"
tls
"
import
{
Emitter
}
from
"
../../src/common/emitter
"
import
{
tmpdir
}
from
"
../../src/node/constants
"
import
{
SocketProxyProvider
}
from
"
../../src/node/socket
"
import
{
generateCertificate
,
tmpdir
}
from
"
../../src/node/util
"
import
{
generateCertificate
}
from
"
../../src/node/util
"
describe
(
"
SocketProxyProvider
"
,
()
=>
{
const
provider
=
new
SocketProxyProvider
()
...
...
test/unit/update.test.ts
浏览文件 @
cb65590b
import
{
promises
as
fs
}
from
"
fs
"
import
*
as
http
from
"
http
"
import
*
as
path
from
"
path
"
import
{
tmpdir
}
from
"
../../src/node/constants
"
import
{
SettingsProvider
,
UpdateSettings
}
from
"
../../src/node/settings
"
import
{
LatestResponse
,
UpdateProvider
}
from
"
../../src/node/update
"
import
{
tmpdir
}
from
"
../../src/node/util
"
describe
.
skip
(
"
update
"
,
()
=>
{
let
version
=
"
1.0.0
"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录