Code Monkey home page Code Monkey logo

fntest's Introduction

fntest

Used internally by both the test task of the lein-immutant plugin and Immutant's own integration tests, this library enables you to test against your application while deployed on WildFly or even run your tests within the deployed application itself. Here's an example:

    (ns your.test-code
      (:use clojure.test)
      (:require [clj-http.client :as http]
                [fntest.core     :as fnt]))
    
    ;;; Run Immutant and deploy our application
    (use-fixtures :once
      (compose-fixtures
        fnt/with-jboss
        (fnt/with-deployment "some-name" "/path/to/war-file/or/lein/project")))

    ;;; Run browser tests against the deployed app
    (deftest remote-http-test
      (let [result (http/get (format "http://localhost:%d/foo" (fnt/offset-port :http)))]
        (is (.contains (:body result) "Howdy!"))))
        
    ;;; Alternatively, deploy and run all tests in one shot, but be
    ;;; careful not to invoke test-in-container inside the container!
    (deftest run-all-tests-inside-immutant
      (is (fnt/test-in-container "some-name" "./" :dirs ["container"])))

Midje, Expectations and clojure.test tests are supported by fntest.core/test-in-container. Which tests are run depends on which testing library is found on the classpath. If Midje is present, then both Midje and clojure.test tests are run via the Midje test runner. If Midje is not found, but Expectations is present, then only the Expectations tests are run. If neither Midje nor Expectations is found, the standard clojure.test test runner is used.

fntest's People

Contributors

jcrossley3 avatar pjlegato avatar ray-metail avatar tobias avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fntest's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.