Skip to content

Commit

Permalink
Remove invalid project test.
Browse files Browse the repository at this point in the history
Reason is specified in the comment. Please refer the patch.
  • Loading branch information
ManasJayanth committed Nov 10, 2024
1 parent 675f675 commit dfad229
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
10 changes: 10 additions & 0 deletions esy-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,16 @@ returns project root"
(let* ((cwd (esy/internal--cwd-of-buffer-or-default buffer)))
(esy/internal--esy-status cwd)))

;; The following is function doesn't try to guarantee non-existence
;; of an esy/npm/opam project. Because 'esy status' command works
;; in any path.
;; So, we don't return nil signalling missing a project. We, instead,
;; ask the user for a project root, just in case we're wrong.
;; This could be re-visited. We need a good project use-case to see
;; if we infact need to be lenient and fallback to user input.
;; If we dont find a compelling reason to be so lenient, we could fail
;; hard.
;; Considering this, we can remove the test for invalid project.
(defun esy/project--of-path (project-path)
"Returns an abstract structure that can later
be used to obtain more info about the project"
Expand Down
17 changes: 0 additions & 17 deletions tests/esy.el
Original file line number Diff line number Diff line change
Expand Up @@ -297,23 +297,6 @@ project with a package.json (but no esy field in it)"
:teardown (lambda (fixture-project-path)
(delete-directory fixture-project-path t))))

(ert-deftest
test-esy/project--utils-for-invalid-project
()
"Tests esy/project--* utils on an project with empty manifest"
(ert/test-suite :setup (lambda (tmp-dir)
(let* ((test-esy-project-dir (concat (file-name-as-directory tmp-dir)
"test-esy-project-failing")))
(progn (delete-directory test-esy-project-dir t)
(make-directory test-esy-project-dir)
test-esy-project-dir)))
:body (lambda (fixture-project-path)
(let* ((project (esy/project--of-path fixture-project-path)))
(should (not (esy/project--p project)))
(should (not (esy/project--ready-p project)))))
:teardown (lambda (fixture-project-path)
(delete-directory fixture-project-path t))))

(ert-deftest
test-esy/esy/internal--is-file-from-source-cache
()
Expand Down

0 comments on commit dfad229

Please sign in to comment.