Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
node-ftp-server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mickael Gomez
node-ftp-server
Commits
a231b4cd
Commit
a231b4cd
authored
4 years ago
by
matryxxx02
Browse files
Options
Downloads
Patches
Plain Diff
add fs tests
parent
709d6785
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/connection.test.js
+0
-17
0 additions, 17 deletions
test/connection.test.js
test/fileSystem.test.js
+69
-0
69 additions, 0 deletions
test/fileSystem.test.js
with
69 additions
and
17 deletions
test/connection.test.js
deleted
100644 → 0
+
0
−
17
View file @
709d6785
import
Server
from
'
../modules/Server.js
'
describe
(
'
test connections
'
,
()
=>
{
//creer serveur
//creer socket qui s'y connect et tester
const
connection
=
new
ConnectionFTP
()
it
(
'
prepare connection
'
,
()
=>
{
const
passive
=
Passive
()
return
active
.
setupConnection
(
host
,
PORT
)
.
then
(()
=>
{
expect
(
active
.
dataSocket
).
to
.
exist
;
});
});
})
\ No newline at end of file
This diff is collapsed.
Click to expand it.
test/fileSystem.test.js
0 → 100644
+
69
−
0
View file @
a231b4cd
import
FileSystem
from
'
../modules/FileSystem.js
'
import
chai
from
'
chai
'
const
expect
=
chai
.
expect
;
describe
(
'
test file system commands
'
,
()
=>
{
const
fs
=
new
FileSystem
()
it
(
'
CWD
'
,
()
=>
{
return
fs
.
cwd
().
then
((
path
)
=>
{
expect
(
path
).
to
.
equal
(
'
250 Directory successfully changed.
'
);
})
});
it
(
'
PWD
'
,
()
=>
{
const
path
=
fs
.
pwd
()
console
.
log
(
path
)
return
expect
(
path
).
to
.
equal
(
'
257 "/" is the current directory.
'
);
});
it
(
'
CDUP
'
,
()
=>
{
const
path
=
fs
.
cdup
()
console
.
log
(
path
)
return
expect
(
path
).
to
.
equal
(
'
250 Directory successfully changed.
'
);
});
it
(
'
LIST
'
,
()
=>
{
return
fs
.
list
().
then
((
ls
)
=>
{
console
.
log
(
ls
)
expect
(
ls
).
to
.
equal
(
'
250 Directory successfully changed.
'
);
});
});
it
(
'
MKD
'
,
()
=>
{
return
fs
.
mkd
(
'
testDirectory
'
).
then
((
mkd
)
=>
{
console
.
log
(
mkd
)
expect
(
mkd
).
to
.
equal
(
'
250 Successfuly created.
'
);
});
});
it
(
'
RNFR and RNTO
'
,
()
=>
{
fs
.
rnfr
(
"
testDirectory
"
);
return
fs
.
rnto
(
'
testDir
'
).
then
((
res
)
=>
{
console
.
log
(
res
)
expect
(
res
).
to
.
equal
(
'
250 Successfuly renamed.
'
);
});
});
it
(
'
RMD
'
,
()
=>
{
return
fs
.
rmd
(
'
testDir
'
).
then
((
rmd
)
=>
{
console
.
log
(
rmd
)
expect
(
rmd
).
to
.
equal
(
'
250 Successfuly deleted.
'
);
});
});
it
(
'
RETR
'
,
()
=>
{
const
path
=
fs
.
pwd
()
console
.
log
(
path
)
return
expect
(
path
).
to
.
equal
(
''
);
});
it
(
'
STOR
'
,
()
=>
{
return
fs
.
stor
(
'
testDir
'
).
then
((
rmd
)
=>
{
console
.
log
(
rmd
)
expect
(
rmd
).
to
.
equal
(
''
);
});
});
});
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment