
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
postcss-parser-tests
Advanced tools
This project contains base tests for every PostCSS CSS parser, including:
These tests are useful for any CSS parser, not just parsers within the PostCSS ecosystem.
You can iterate through all test cases using the cases.each
method:
const cases = require('postcss-parser-tests')
cases.each((name, css, ideal) => {
it('parses ' + name, () => {
const root = parse(css, { from: name })
const json = cases.jsonify(root)
expect(json).toEquql(ideal)
})
})
This returns the case name, CSS string, and PostCSS AST JSON.
If you create a non-PostCSS parser, just compare if the input CSS is equal to the output CSS after parsing.
You can also get the path to some specific test cases using the cases.path(name)
method.
Integration tests are packed into a Gulp task:
const cases = require('postcss-parser-tests')
cases.real(css => {
return parser(css).toResult({ map: { annotation: false } })
})
Your callback must parse CSS and stringify it back. The plugin will then compare the input and output CSS.
You can add extra sites using an optional third argument:
cases.real(css => {
return parser(css).toResult({ map: { annotation: false } })
}, [
'http://browserhacks.com/'
])
8.9.0
offset
according to fix in postcss
(by Ido Rosenthal).jsonify()
from string
to object
.eachTest()
from string
to object
in json
argument.source.end
for Root
(by Romain Menke).FAQs
Base tests for every PostCSS CSS parser
The npm package postcss-parser-tests receives a total of 1,081 weekly downloads. As such, postcss-parser-tests popularity was classified as popular.
We found that postcss-parser-tests demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.