-
Notifications
You must be signed in to change notification settings - Fork 5.9k
feat: add tests for isWsl #5251
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✨ code-server docs for PR #5251 is ready! It will be updated on every commit.
|
test/unit/node/util.test.ts
Outdated
const testDir = path.join(tmpdir, "tests", "isWsl-linux-microsoft") | ||
let pathToFile = "" | ||
|
||
beforeEach(async () => { | ||
pathToFile = path.join(testDir, "/proc-version") | ||
await fs.mkdir(testDir, { recursive: true }) | ||
await fs.writeFile(pathToFile, "microsoft") | ||
}) | ||
afterEach(async () => { | ||
await fs.rm(testDir, { recursive: true, force: true }) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried taking these lines and making a setupIsWslTest
but Jest couldn't comprehend the inner beforeEach
and afterEach
so I ditched it.
Codecov Report
@@ Coverage Diff @@
## main #5251 +/- ##
==========================================
+ Coverage 71.85% 72.00% +0.14%
==========================================
Files 30 30
Lines 1663 1668 +5
Branches 367 367
==========================================
+ Hits 1195 1201 +6
+ Misses 401 400 -1
Partials 67 67
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! I left some suggestions to use real examples for release and version strings on Linux and WSL.
Co-authored-by: Asher <ash@coder.com>
Co-authored-by: Asher <ash@coder.com>
Related to #5153
TODOs
darwin
and no/proc/version
file