Comments (5)
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.
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.
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.
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.
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)
- Failed to build when webpack alias for asset is an array of paths instead of a single path HOT 5
- [CRITICAL] [SECURITY] Pug variables leak between different executions of rendered templates HOT 10
- Path errors on Windows? HOT 6
- How to use it with tailwindcss and server side rendering? HOT 13
- [Bug] Pug error in dependency requires restart of webpack HOT 9
- Support resolving modules HOT 1
- Compile error on bad JS Syntax is confusing HOT 3
- Support Webpack defined modules HOT 4
- Missing peer dependency pug-walk HOT 3
- Cannot read properties of undefined (reading 'sync') in @webdiscus\pug-loader\src\Resolver.js HOT 2
- Vue production build errors in example HOT 6
- hello-world-app does not compile HOT 3
- webpack-dev-server: pages require access with .html HOT 7
- Doesn't fix indent pug with @webdiscus/pug-loader on nuxt 3 (vite) HOT 3
- Will this support pug3? HOT 2
- Improve the error message to find where the error occurred HOT 2
- `include` doesn't use dynamic `resolve.alias` (from tsconfig-paths-webpack-plugin) HOT 11
- img srcset attribute HOT 3
- htmlWebpackPlugin.options not available in pug template HOT 10
- Errors don't show the exact location of the error HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pug-loader.