Skip to content

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

Merged
merged 7 commits into from
Jun 10, 2022
Merged

feat: add tests for isWsl #5251

merged 7 commits into from
Jun 10, 2022

Conversation

jsjoeio
Copy link
Contributor

@jsjoeio jsjoeio commented Jun 8, 2022

  • refactor: add docs to isWsl and make easier to test
  • feat: add tests for isWsl

Related to #5153

TODOs

  • check for darwin and no /proc/version file

@github-actions
Copy link

github-actions bot commented Jun 8, 2022

✨ code-server docs for PR #5251 is ready! It will be updated on every commit.

@jsjoeio jsjoeio changed the title jsjoeio/iswsl tests feat: add tests for isWsl Jun 8, 2022
@jsjoeio jsjoeio self-assigned this Jun 8, 2022
@jsjoeio jsjoeio added the testing Anything related to testing label Jun 8, 2022
@jsjoeio jsjoeio added this to the June 2022 milestone Jun 8, 2022
Comment on lines 488 to 498
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 })
})
Copy link
Contributor Author

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
Copy link

codecov bot commented Jun 8, 2022

Codecov Report

Merging #5251 (5bc97ee) into main (d75883b) will increase coverage by 0.14%.
The diff coverage is 70.00%.

Impacted file tree graph

@@            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              
Impacted Files Coverage Δ
src/node/util.ts 87.42% <70.00%> (+0.95%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d75883b...5bc97ee. Read the comment docs.

@jsjoeio jsjoeio temporarily deployed to npm June 8, 2022 23:25 Inactive
@github-actions
Copy link

github-actions bot commented Jun 8, 2022

✨ code-server dev build published to npm for PR #5251!

  • Last publish status: success
  • Commit: 5bc97ee

To install in a local project, run:

npm install @coder/code-server-pr@5251

To install globally, run:

npm install -g @coder/code-server-pr@5251

@jsjoeio jsjoeio marked this pull request as ready for review June 9, 2022 15:10
@jsjoeio jsjoeio requested a review from a team June 9, 2022 15:10
@jsjoeio jsjoeio requested a review from code-asher June 9, 2022 18:12
@jsjoeio jsjoeio temporarily deployed to npm June 9, 2022 18:17 Inactive
Copy link
Member

@code-asher code-asher left a 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.

jsjoeio and others added 2 commits June 9, 2022 12:26
Co-authored-by: Asher <ash@coder.com>
Co-authored-by: Asher <ash@coder.com>
@jsjoeio jsjoeio enabled auto-merge (squash) June 9, 2022 19:26
@jsjoeio jsjoeio temporarily deployed to npm June 10, 2022 19:41 Inactive
@jsjoeio jsjoeio merged commit 2c1cf02 into main Jun 10, 2022
@jsjoeio jsjoeio deleted the jsjoeio/iswsl-tests branch June 10, 2022 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Anything related to testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants