Coder Social home page Coder Social logo

ts-jest-sample's Issues

stepping into code debugging source not working

Hi,

So i had two issue initially when i ran your example. One was addressed here #1 with the fix of adding a different configuration in launch.

Afterwards, I wrote some extra code and tried to step into it. However, whenever i stepped into the method it would not line up or it would be off by a line. I'm guessing there is some is something i'm missing about the source mapping.

https://github.com/darewreck54/ts-jest-sample

if you run this repo, and put a break point at line 29 sound-consumer.spec.ts and step into it, you'll notice that you are off by a line. It will jump to the file, but be one line offset of where it should be.

Also if you update the version of
"devDependencies": {
"@types/jest": "^23.0.0",
"jest": "^23.1.0",
"typescript": "^2.9.1"
},
"scripts": {
"compile": "tsc",
"test": "jest"
},
"dependencies": {
"ts-jest": "^22.4.6"
}

and run it again, you will notice that when you step into the same file, it will be way off; whether its stepping into the contructor of SoundPlayerConsumer or when you step into the method playSoundFile

i'm currently using npm 6.1.0 and node 8.11.2

Any idea how to fix the source mapping issue?

Thanks,
Derek

Cannot translate your work to a new project

Your project runs fine. But I am getting a lot of errors that describe, it, and expect cannot be found in my test. Where are these coming from?

My test looks like:

describe('A suite', function() {
  it('should render without throwing an error', function() {
    expect(shallow(<CancelButton />).contains(<button className="btn btn-default"></button>)).toBe(true);
  });

  it('should be selectable by class "foo"', function() {
    expect(shallow(<CancelButton />).contains(<button className="btn btn-default"></button>)).toBe(true);
    expect(shallow(<CancelButton />).is('.btn')).toBe(true);
  });

  it('should mount in a full DOM', function() {
    expect(mount(<CancelButton />).find('.btn').length).toBe(1);
  });
});

Timeout

Hello, when I clone and do Yarn install, it just times out when running debugger.
Am on Mac with latest code and Node 11.

Don't compile tests

This compiles __tests__ into lib as well.
I'd like to only compile src.
But as soon as I add "include": ["src"] to tsconfig.json, It stops applying that config to the tests VS Code.
What to do?

npm test failure

npm 5.6.0 node 8.10.0 on windows same issue on linux node 10.9.0 npm 6.4.1
just cloned it did a npm i then npm test and crash:
which is annoying be cause i cloned your project because of the same error
FAIL tests\base.spec.ts
● Test suite failed to run

SecurityError: localStorage is not available for opaque origins

  at Window.get localStorage [as localStorage] (node_modules/jsdom/lib/jsdom/browser/Window.js:257:15)
      at Array.forEach (<anonymous>)

----------|----------|----------|----------|----------|-------------------|

File % Stmts % Branch % Funcs % Lines Uncovered Line #s
All files Unknown Unknown Unknown Unknown
---------- ---------- ---------- ---------- ---------- -------------------
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 1.495s
Ran all test suites.
npm ERR! Test failed. See above for more details.

Some medium+ vulnerable packages

I've tried snyk to test my repo's and fond some
What you think about them?

Tested 110 dependencies for known vulnerabilities, found 6 vulnerabilities, 23 vulnerable paths.
? ✗ 14 Low vulnerabilities introduced in hoek
    Info: https://snyk.io/package/npm/hoek/2.16.3

? ✗ Medium severity vuln found in [email protected], introduced via [email protected]
    Description: Uninitialized Memory Exposure
    Info: https://snyk.io/vuln/npm:stringstream:20180511
    From: [email protected] > [email protected] > [email protected]

? ✗ Medium severity vuln found in [email protected], introduced via [email protected]
    Description: Insecure Randomness
    Info: https://snyk.io/vuln/npm:cryptiles:20180710

? ✗ Medium severity vuln found in [email protected], introduced via [email protected]
    Description: Insecure Randomness
    Info: https://snyk.io/vuln/npm:cryptiles:20180710
    From: [email protected] > [email protected]

? ✗ Medium severity vuln found in [email protected], introduced via [email protected]
    Description: Insecure Randomness
    Info: https://snyk.io/vuln/npm:cryptiles:20180710
    From: [email protected] > [email protected] > [email protected]

? ✗ Medium severity vuln found in [email protected], introduced via [email protected]
    Description: Insecure Randomness
    Info: https://snyk.io/vuln/npm:cryptiles:20180710
    From: [email protected] > [email protected] > [email protected] > [email protected]

Seem's that we can try to fix with upgrading?

Does this no longer work?

I've cloned this - and can't get it work on my workspace.

Node version 8.11.2

I clone, npm i and npm test and I get:

> [email protected] test /home/davidj/git-workspace/ts-jest-sample
> jest --verbose

● Deprecation Warning:

  Option "mapCoverage" has been removed, as it's no longer necessary.

  Please update your configuration.

  Configuration Documentation:
  https://facebook.github.io/jest/docs/configuration.html

ie. no test output

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.