Giter VIP home page Giter VIP logo

Comments (4)

rcarriga avatar rcarriga commented on July 19, 2024

No it's intended behaviour to open on successful tests.

You can use a custom consumer if you want to always show output on run

local neotest = require("neotest")
neotest.setup({
  consumers = {

    always_open_output = function(client)
      local async = require("neotest.async")

      client.listeners.results = function(adapter_id, results)
        local file_path = async.fn.expand("%:p")
        local row = async.fn.getpos(".")[2] - 1
        local position = client:get_nearest(file_path, row, {})
        if not position then
          return
        end
        local pos_id = position:data().id
        if not results[pos_id] then
          return
        end
        neotest.output.open({ position_id = pos_id, adapter = adapter_id })
      end
    end,
  },
  ...

from neotest.

rouge8 avatar rouge8 commented on July 19, 2024

No it's intended behaviour to open on successful tests

So it’s a bug that it’s not?

from neotest.

rcarriga avatar rcarriga commented on July 19, 2024

No meant to say it's not intended behaviour

from neotest.

rouge8 avatar rouge8 commented on July 19, 2024
  consumers = {

    always_open_output = function(client)
      local async = require("neotest.async")

      client.listeners.results = function(adapter_id, results)
        local file_path = async.fn.expand("%:p")
        local row = async.fn.getpos(".")[2] - 1
        local position = client:get_nearest(file_path, row, {})
        if not position then
          return
        end
        local pos_id = position:data().id
        if not results[pos_id] then
          return
        end
        neotest.output.open({ position_id = pos_id, adapter = adapter_id })
      end
    end,
  },

This works, thanks!

from neotest.

Related Issues (20)

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.