Skip to content

Commit

Permalink
test: Replace deprecated new Buffer() call with Buffer.from()
Browse files Browse the repository at this point in the history
  • Loading branch information
sdvg authored and gr2m committed May 1, 2017
1 parent d3357e2 commit 1e8fd23
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/unit/plugins-client-bundle-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require('npmlog').level = 'error'

test('bundle client', function (group) {
group.test('client & bundle with same mtime', function (t) {
var readFileMock = simple.stub().callbackWith(null, new Buffer('bundle content'))
var readFileMock = simple.stub().callbackWith(null, Buffer.from('bundle content'))
var bundleClient = proxyquire('../../server/plugins/client/bundle', {
fs: {
readFile: readFileMock,
Expand All @@ -26,7 +26,7 @@ test('bundle client', function (group) {
})

group.test('bundle does not exist', function (t) {
var bundleMock = simple.stub().callbackWith(null, new Buffer('hoodie client content'))
var bundleMock = simple.stub().callbackWith(null, Buffer.from('hoodie client content'))
var requireMock = simple.stub()

var streamStub = {
Expand Down Expand Up @@ -71,7 +71,7 @@ test('bundle client', function (group) {
})

group.test('with client options', function (t) {
var bundleMock = simple.stub().callbackWith(null, new Buffer('hoodie client content'))
var bundleMock = simple.stub().callbackWith(null, Buffer.from('hoodie client content'))
var requireMock = simple.stub()

var streamStub = {
Expand Down Expand Up @@ -153,7 +153,7 @@ test('bundle client', function (group) {
})

group.test('app\'s root directory is specified', function (t) {
var bundleMock = simple.stub().callbackWith(null, new Buffer('hoodie client content'))
var bundleMock = simple.stub().callbackWith(null, Buffer.from('hoodie client content'))
var requireMock = simple.stub()
var unspecifiedError = new Error('UNSPECIFIED_ERROR')
var savedPath = process.cwd()
Expand Down Expand Up @@ -244,7 +244,7 @@ test('bundle client', function (group) {

return callback(null, {mtime: currentDate})
})
fsMock.readFile = simple.stub().callbackWith(null, new Buffer('bundle content'))
fsMock.readFile = simple.stub().callbackWith(null, Buffer.from('bundle content'))
process.chdir(pathResolve(__dirname, '../fixture/app-dir-with-server/'))
bundleClient('client.js', 'bundle.js', {
url: 'https://myapp.com'
Expand Down

0 comments on commit 1e8fd23

Please sign in to comment.