-
Notifications
You must be signed in to change notification settings - Fork 3.3k
dependency: update trash dep and convert trash files from JS to TS #31667
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
cypress
|
Project |
cypress
|
Branch Review |
update-trash
|
Run status |
|
Run duration | 18m 17s |
Commit |
|
Committer | Jennifer Shehane |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
2
|
|
781
|
|
0
|
|
6345
|
View all changes introduced in this branch ↗︎ |
UI Coverage
0%
|
|
---|---|
|
4
|
|
0
|
Accessibility
97.09%
|
|
---|---|
|
0 critical
1 serious
0 moderate
0 minor
|
|
6
|
…into update-trash
}) | ||
|
||
context('.folder', () => { | ||
it('trashes contents of directory in non-Linux', async () => { |
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.
This test used to use mock-fs, but it would literally fail every time you ran it locally on a mac because the trash code was literally trying to trash a file that never existed, so this has been updated to just make temp directories during the tests outright.
@@ -51,6 +51,7 @@ const getDependencyPathsToKeep = async (buildAppDir) => { | |||
'node_modules/html-webpack-plugin-5/index.js', | |||
'node_modules/mocha-7.2.0/index.js', | |||
'packages/server/node_modules/webdriver/build/index.js', | |||
'packages/server/node_modules/@wdio/utils/build/node.js', |
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.
See this thread: https://cypressio.slack.com/archives/C06G5D5KFCJ/p1746724397061149
@@ -0,0 +1,34 @@ | |||
import { fs } from './fs' |
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.
This was rewritten a bit, so review carefully
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Additional details
I was originally looking into options to fix this issue: #24582 But that would require our server package supporting ESM.
This just updates the trash dep and converts the files to TS as a chore update basically.
Steps to test
The main application of this trash function is when
trashAssetsBeforeRuns
is set totrue
, thescreenshotsFolder
,videosFolder
, anddownloadsFolder
CONTENTS should be trashed/emptied (depending on OS). So this could be manually tested.I tested this locally on my Mac, that the previous contents were removed on a new run in run mode.
First run
Second run
Example ran
file.txt
cypress.config.js
spec.cy.js
How has the user experience changed?
Users might see some bug fixes or performance improvements with trashing on Linux as some of those fixes were included in the trash 6.x and 7.x updates. https://github.com/sindresorhus/trash/releases
PR Tasks
cypress-documentation
?type definitions
?