Code Monkey home page Code Monkey logo

Comments (5)

webdiscus avatar webdiscus commented on June 1, 2024 1

Hello @daomatys,

thank you for the bug report.
In linux it works.
It looks like the problem is in Windows environment. I will try fix it for Windows.

from pug-loader.

webdiscus avatar webdiscus commented on June 1, 2024 1

Hello @daomatys,

thank you for test report.
These errors are not important. Main and important tests are passed.
The problem in two cases is either with cached old tests or with the wrong formatting of Newline in Git on Windows.

For example, in this case extend / include / raw include › include-alias:
the expected file contain 1:1 what is received:

<h1>Test includes</h1><h2>include A</h2><p>mixin A</p><h3>include B</h3><p>mixin B</p><h4>include C</h4><h1>Markdown test</h1>
<p>end</p>

How is configured Git on Windows?
Git configuration for Newline must be as is, without NL transformation

Yet one cause: sometime at first run test some tests failed. But the next attempt was successful. Try 2-3 times.

So, on Win 10 all test are passed. Your project metalamp-fedsec-layouts with the @webdiscus/pug-loader has been successfully builded on Win 10. The project started local on Windows with npm run host as well successful.

Please, try run your project with @webdiscus/pug-loader.

from pug-loader.

daomatys avatar daomatys commented on June 1, 2024

Sorry, i forgot to add an example of alias usage:

./src/components/favicons-bulk/favicons-bulk.pug

mixin faviconsBulk()
  link( rel="icon" type="image/png" href=require("@images/favicon/favicon-196x196.png") sizes="196x196" )
  link( rel="icon" type="image/png" href=require("@images/favicon/favicon-96x96.png"  ) sizes="96x96"   )
  link( rel="icon" type="image/png" href=require("@images/favicon/favicon-32x32.png"  ) sizes="32x32"   )

from pug-loader.

webdiscus avatar webdiscus commented on June 1, 2024

Hello @daomatys,

I have fixed the issues on windows (tested on Win 10), ver. 1.5.1.
Can you please try test it?

npm run test

from pug-loader.

daomatys avatar daomatys commented on June 1, 2024

Hello, @webdiscus,

Yea, here is my test log

OS: Win 10 Pro, ver. 21H1,

> @webdiscus/[email protected] test D:\Max\coder\jScriptBay\pug-loader
> jest --detectOpenHandles --config ./test/jest.config.js

 PASS  test/index.unit.test.js
 FAIL  test/index.integration.test.js (23.431 s)
  ● pug tests › escape render

    expect(received).toEqual(expected) // deep equality

    - Expected  - 3
    + Received  + 3

    - <h1>Hello world!</h1><p>"double quotes"</p><p>'single quotes'</p><p>`backtick`</p><p>Newline string,
    + <h1>Hello world!</h1><p>"double quotes"</p><p>'single quotes'</p><p>`backtick`</p><p>Newline string,
    - next newline
    + next newline
    - </p><p>Add strings:string1 with |
    + </p><p>Add strings:string1 with |
      string2 with |</p>

      21 |     const received = readTextFileSync(path.join(absTestPath, PATHS.webRoot, receivedFile));
      22 |     const expected = readTextFileSync(path.join(absTestPath, PATHS.expected, expectedFile));
    > 23 |     expect(received).toEqual(expected);
         |                      ^
      24 |     done();
      25 |   });
      26 | };

      at utils/helpers.js:23:22

  ● pug tests › escape render

    thrown: "Exceeded timeout of 5000 ms for a test.
    Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

      39 |   });
      40 |
    > 41 |   test('escape render', (done) => {
         |   ^
      42 |     const relTestCasePath = 'escape-render';
      43 |     compareContent(PATHS, relTestCasePath, done);
      44 |   });

      at index.integration.test.js:41:3
      at Object.<anonymous> (index.integration.test.js:35:1)

  ● extend / include / raw include › include-alias

    expect(received).toEqual(expected) // deep equality

    - Expected  - 1
    + Received  + 1

    - <h1>Test includes</h1><h2>include A</h2><p>mixin A</p><h3>include B</h3><p>mixin B</p><h4>include C</h4><h1>Markdown test</h1>
    + <h1>Test includes</h1><h2>include A</h2><p>mixin A</p><h3>include B</h3><p>mixin B</p><h4>include C</h4><h1>Markdown test</h1>
      <p>end</p>

      21 |     const received = readTextFileSync(path.join(absTestPath, PATHS.webRoot, receivedFile));
      22 |     const expected = readTextFileSync(path.join(absTestPath, PATHS.expected, expectedFile));
    > 23 |     expect(received).toEqual(expected);
         |                      ^
      24 |     done();
      25 |   });
      26 | };

      at utils/helpers.js:23:22

  ● extend / include / raw include › include-alias

    thrown: "Exceeded timeout of 5000 ms for a test.
    Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

      56 |   });
      57 |
    > 58 |   test('include-alias', (done) => {
         |   ^
      59 |     const relTestCasePath = 'include-alias';
      60 |     compareContent(PATHS, relTestCasePath, done);
      61 |   });

      at index.integration.test.js:58:3
      at Object.<anonymous> (index.integration.test.js:47:1)

Test Suites: 1 failed, 1 passed, 2 total
Tests:       2 failed, 73 passed, 75 total
Snapshots:   0 total
Time:        25.211 s
Ran all test suites.

from pug-loader.

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.