Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ npm-debug.log
.DS_Store
.nyc_output/
coverage/
package-lock.json
yarn.lock
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ npm-debug.log*
pids
test
test.js
yarn.lock
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module.exports = withConfigLoader(function (loadConfig) {
var map
var warnings = result.warnings().join('\n')

file.contents = new Buffer(result.css)
file.contents = Buffer.from(result.css)

// Apply source map to the chain
if (file.sourceMap) {
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
"version": "8.0.0",
"description": "PostCSS gulp plugin",
"main": "index.js",
"engines": {
"node": ">=6"
},
"scripts": {
"coveralls": "coveralls < coverage/lcov.info",
"pretest": "eslint *.js",
Expand Down
34 changes: 17 additions & 17 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ it('should transform css with multiple processors', function (cb) {
})

stream.write(new Vinyl({
contents: new Buffer('a { color: black }')
contents: Buffer.from('a { color: black }')
}))

stream.end()
Expand All @@ -64,7 +64,7 @@ it('should not transform css with out any processor', function (cb) {
})

stream.write(new Vinyl({
contents: new Buffer(css)
contents: Buffer.from(css)
}))

stream.end()
Expand All @@ -89,7 +89,7 @@ it('should correctly wrap postcss errors', function (cb) {
})

stream.write(new Vinyl({
contents: new Buffer('a {'),
contents: Buffer.from('a {'),
path: path.resolve('testpath')
}))

Expand Down Expand Up @@ -143,7 +143,7 @@ it('should generate source maps', function (cb) {
init.write(new Vinyl({
base: __dirname,
path: __dirname + '/fixture.css',
contents: new Buffer('a { color: black }')
contents: Buffer.from('a { color: black }')
}))

init.end()
Expand All @@ -169,7 +169,7 @@ it('should correctly generate relative source map', function (cb) {
init.write(new Vinyl({
base: __dirname + '/src',
path: __dirname + '/src/fixture.css',
contents: new Buffer('a { color: black }')
contents: Buffer.from('a { color: black }')
}))

init.end()
Expand All @@ -179,7 +179,7 @@ it('should correctly generate relative source map', function (cb) {

describe('PostCSS Guidelines', function () {

var sandbox = sinon.sandbox.create()
var sandbox = sinon.createSandbox()
var CssSyntaxError = function (message, source) {
this.name = 'CssSyntaxError'
this.message = message
Expand Down Expand Up @@ -241,7 +241,7 @@ describe('PostCSS Guidelines', function () {
})

stream.write(new Vinyl({
contents: new Buffer('a {}'),
contents: Buffer.from('a {}'),
path: cssPath
}))

Expand All @@ -265,7 +265,7 @@ describe('PostCSS Guidelines', function () {
})

stream.write(new Vinyl({
contents: new Buffer('a {}')
contents: Buffer.from('a {}')
}))

stream.end()
Expand All @@ -276,7 +276,7 @@ describe('PostCSS Guidelines', function () {

var cssPath = __dirname + '/fixture.css'
var file = new Vinyl({
contents: new Buffer('a {}'),
contents: Buffer.from('a {}'),
path: cssPath
})
var plugins = [ doubler ]
Expand Down Expand Up @@ -308,7 +308,7 @@ describe('PostCSS Guidelines', function () {

var cssPath = __dirname + '/fixture.css'
var file = new Vinyl({
contents: new Buffer('a {}'),
contents: Buffer.from('a {}'),
path: cssPath
})
var stream = postcss({ to: 'initial' })
Expand Down Expand Up @@ -355,7 +355,7 @@ describe('PostCSS Guidelines', function () {
cb()
})
stream.end(new Vinyl({
contents: new Buffer('a {}'),
contents: Buffer.from('a {}'),
path: cssPath
}))
})
Expand All @@ -375,7 +375,7 @@ describe('PostCSS Guidelines', function () {
cb()
})
stream.end(new Vinyl({
contents: new Buffer('a {}'),
contents: Buffer.from('a {}'),
path: cssPath
}))
})
Expand All @@ -395,7 +395,7 @@ describe('PostCSS Guidelines', function () {
cb()
})
stream.end(new Vinyl({
contents: new Buffer('a {}'),
contents: Buffer.from('a {}'),
path: cssPath,
base: __dirname
}))
Expand Down Expand Up @@ -432,7 +432,7 @@ describe('PostCSS Guidelines', function () {
})

var file = new Vinyl({
contents: new Buffer('a {}'),
contents: Buffer.from('a {}'),
path: cssPath
})
file.sourceMap = {}
Expand All @@ -453,7 +453,7 @@ describe('PostCSS Guidelines', function () {
})

stream.write(new Vinyl({
contents: new Buffer('a {}')
contents: Buffer.from('a {}')
}))

stream.end()
Expand Down Expand Up @@ -485,7 +485,7 @@ describe('PostCSS Guidelines', function () {
})

stream.write(new Vinyl({
contents: new Buffer('a {}'),
contents: Buffer.from('a {}'),
path: cssPath
}))

Expand Down Expand Up @@ -520,7 +520,7 @@ describe('PostCSS Guidelines', function () {
})

stream.write(new Vinyl({
contents: new Buffer('a {}'),
contents: Buffer.from('a {}'),
path: cssPath
}))

Expand Down