Giter VIP home page Giter VIP logo

Comments (7)

mikaoelitiana avatar mikaoelitiana commented on July 19, 2024 1

I have tried using Neotest with jest and the adapter but I get an output No tests found. I have already run TSInstall typescript and TSInstall javascript but did not fixed my issue

from neotest.

rcarriga avatar rcarriga commented on July 19, 2024

Yep absolutely happy to help 😄 Jest is likely to be a very popular runner so I'd be delighted to have someone take it on! My javascript is pretty rusty so hopefully most of your issues are in Lua land.

from neotest.

haydenmeade avatar haydenmeade commented on July 19, 2024

I have written (badly) a jest plugin that works for my use cases
https://github.com/haydenmeade/neotest-jest

from neotest.

khanghoang avatar khanghoang commented on July 19, 2024

This is great. I will definitely check your code later.

from neotest.

haydenmeade avatar haydenmeade commented on July 19, 2024

Do you have a sample of what your test file looks like?
Describe...
It(...

Bit hard to help if I don't have some more info

from neotest.

mikaoelitiana avatar mikaoelitiana commented on July 19, 2024

Do you have a sample of what your test file looks like? Describe... It(...

Bit hard to help if I don't have some more info

Hi @haydenmeade,

In fact I first had something wrong in my neotest setup, this is now fixed and the tests are found.

Now the issue is slightly different, the tests are shown in the summary view, but when I run them, they seems not to be found. Here is a sample test I have :

port React from "react";

import { renderComponent } from "@tests/unit/utils/render-component";

import { RefundProtection } from "./refund-protection";

describe("Refund protection", () => {
  it("has a title", () => {
    const { getByText } = renderComponent(<RefundProtection />);
    expect(getByText("!travel-addons.refund-protection.title")).toBeTruthy();
  });

  it("displays a select option message", () => {
    const { getByText } = renderComponent(<RefundProtection />);
    expect(
      getByText("!travel-addons.refund-protection.select-one-option")
    ).toBeTruthy();
  });

  it("not display a select option message", () => {
    const { queryByText } = renderComponent(
      <RefundProtection optionSelected />
    );
    expect(
      queryByText("!travel-addons.refund-protection.select-one-option")
    ).toBeFalsy();
  });
});

Here is what happen in the summary view when I run the test on this file with lua require("neotest").run.run(vim.fn.expand("%"))

Screen.Recording.2022-06-28.at.09.33.40.mov

Here is my adapter configuration :

       require('neotest-jest')({
          jestCommand = "npx jest --"
        })

Finally, when I use the neotest-vim-test adapter, those tests run well

from neotest.

rcarriga avatar rcarriga commented on July 19, 2024

I'm going to close this issue as there is an actively developed solution. Any issues with the adapter should be opened there

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.