diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 8929b52..e1068e4 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -31,14 +31,10 @@ jobs:
restore-keys: |
v2-${{ runner.os }}-opam-${{ matrix.ocaml-version }}-
- name: Use OCaml ${{ matrix.ocaml-version }}
- uses: avsm/setup-ocaml@v1
+ uses: ocaml/setup-ocaml@v2
with:
- ocaml-version: ${{ matrix.ocaml-version }}
- - name: Install dependencies
- if: steps.cache-opam.outputs.cache-hit != 'true'
- run: |
- opam install -y dune
- opam install -y . --deps-only --with-doc --with-test --locked --unlock-base
+ ocaml-compiler: ${{ matrix.ocaml-compiler }}
+ dune-cache: true
- name: Recover from an Opam broken state
if: steps.cache-opam.outputs.cache-hit == 'true'
run: opam upgrade --fixup
diff --git a/Makefile b/Makefile
index 7ed369e..765e2ef 100644
--- a/Makefile
+++ b/Makefile
@@ -16,7 +16,6 @@ build:
clean:
opam exec -- dune clean
-.PHONY: test-all
-test-all:
- curl -s -d '{ "requestor": "letters", "version": "0.1.0" }' "https://api.nodemailer.com/user" -X POST -H "Content-Type: application/json" > ethereal_account.json
+.PHONY: test
+test:
opam exec -- dune runtest --force --no-buffer test
diff --git a/test/dune b/test/dune
index 33ba60e..dbf30fa 100644
--- a/test/dune
+++ b/test/dune
@@ -1,13 +1,8 @@
(executable
(name test)
- (libraries letters alcotest alcotest-lwt lwt))
+ (libraries letters alcotest))
(rule
(alias runtest)
(action
(run ./test.exe)))
-
-(rule
- (alias runtest-all)
- (action
- (run ./test.exe)))
diff --git a/test/test.ml b/test/test.ml
index 86ae248..0b4ad73 100644
--- a/test/test.ml
+++ b/test/test.ml
@@ -12,7 +12,7 @@ let stream_to_string s =
go ()
;;
-let test_create_plain_text_email _ () =
+let test_create_plain_text_email _ =
let recipients = [ To "dave@example.com" ] in
let subject = "Hello" in
let body = Plain "Hello Dave" in
@@ -23,10 +23,10 @@ let test_create_plain_text_email _ () =
| Error reason -> failwith reason
in
let message = stream_to_string stream in
- Lwt.return (print_string message)
+ print_string message
;;
-let test_create_html_email _ () =
+let test_create_html_email _ =
let recipients = [ To "dave@example.com" ] in
let subject = "Hello" in
let body = Html "Hello Dave" in
@@ -37,10 +37,10 @@ let test_create_html_email _ () =
| Error reason -> failwith reason
in
let message = stream_to_string stream in
- Lwt.return (print_string message)
+ print_string message
;;
-let test_create_mixed_body_email _ () =
+let test_create_mixed_body_email _ =
let recipients = [ To "dave@example.com" ] in
let subject = "Hello" in
let body = Mixed ("Hello Dave", "Hello Dave", Some "blaablaa") in
@@ -51,26 +51,22 @@ let test_create_mixed_body_email _ () =
| Error reason -> failwith reason
in
let message = stream_to_string stream in
- Lwt.return (print_string message)
+ print_string message
;;
let () =
- Lwt_main.run
- (Alcotest_lwt.run
- "Email creation"
- [ ( "Generating body"
- , [ Alcotest_lwt.test_case
- "email with plain text body"
- `Quick
- test_create_plain_text_email
- ; Alcotest_lwt.test_case
- "email with HTML text body"
- `Quick
- test_create_html_email
- ; Alcotest_lwt.test_case
- "email with mixed plain text and HTML body"
- `Quick
- test_create_mixed_body_email
- ] )
- ])
+ Alcotest.run
+ "Email creation"
+ [ ( "Generating body"
+ , [ Alcotest.test_case
+ "email with plain text body"
+ `Quick
+ test_create_plain_text_email
+ ; Alcotest.test_case "email with HTML text body" `Quick test_create_html_email
+ ; Alcotest.test_case
+ "email with mixed plain text and HTML body"
+ `Quick
+ test_create_mixed_body_email
+ ] )
+ ]
;;