diff --git a/.ci/.azure-pipelines-steps.yml b/.ci/.azure-pipelines-steps.yml deleted file mode 100644 index 894c21e..0000000 --- a/.ci/.azure-pipelines-steps.yml +++ /dev/null @@ -1,38 +0,0 @@ -steps: -- script: npm i -g npm@$(npm_version) - displayName: Use legacy npm version $(npm_version) - condition: ne(variables['npm_version'], '') - -- task: NodeTool@0 - inputs: - versionSpec: '$(node_version)' - displayName: Use Node $(node_version) - -- script: npm install - displayName: npm install - -- script: npm test - displayName: Run tests - -- script: npm run coveralls - displayName: Run coveralls - env: - # Pretend to be AppVeyor for now - APPVEYOR: true - APPVEYOR_BUILD_NUMBER: $(Build.BuildNumber) - APPVEYOR_BUILD_ID: $(Agent.OS)_$(node_version) - APPVEYOR_REPO_COMMIT: $(Build.SourceVersion) - APPVEYOR_REPO_BRANCH: $(Build.SourceBranchName) - # Overwrite the AppVeyor Service Name - COVERALLS_SERVICE_NAME: Azure Pipelines - COVERALLS_REPO_TOKEN: $(COVERALLS_REPO_TOKEN_SECRET) - COVERALLS_PARALLEL: true - CI_PULL_REQUEST: $(System.PullRequest.PullRequestNumber) - -- script: npm run azure-pipelines - displayName: Write tests to xml - -- task: PublishTestResults@2 - inputs: - testResultsFiles: '**/test.xunit' - condition: succeededOrFailed() diff --git a/.ci/.azure-pipelines.yml b/.ci/.azure-pipelines.yml deleted file mode 100644 index 2d717af..0000000 --- a/.ci/.azure-pipelines.yml +++ /dev/null @@ -1,90 +0,0 @@ -trigger: -- master -- releases/* - -jobs: - - job: Test_Linux - displayName: Run Tests on Linux - pool: - vmImage: "Ubuntu 16.04" - strategy: - matrix: - Node_v12: - node_version: 12 - Node_v10: - node_version: 10 - Node_v8: - node_version: 8 - Node_v6: - node_version: 6 - Node_v4: - node_version: 4 - Node_v0_12: - node_version: 0.12 - Node_v0_10: - node_version: 0.10 - steps: - - template: .azure-pipelines-steps.yml - - - job: Test_Windows - displayName: Run Tests on Windows - pool: - vmImage: vs2017-win2016 - strategy: - matrix: - Node_v12: - node_version: 12 - Node_v10: - node_version: 10 - Node_v8: - node_version: 8 - Node_v6: - node_version: 6 - Node_v4: - node_version: 4 - npm_version: 2 - Node_v0_12: - node_version: 0.12 - npm_version: 2 - Node_v0_10: - node_version: 0.10 - npm_version: 2 - steps: - - template: .azure-pipelines-steps.yml - - - job: Test_MacOS - displayName: Run Tests on MacOS - pool: - vmImage: macos-10.13 - strategy: - matrix: - Node_v12: - node_version: 12 - Node_v10: - node_version: 10 - Node_v8: - node_version: 8 - Node_v6: - node_version: 6 - Node_v4: - node_version: 4 - Node_v0_12: - node_version: 0.12 - Node_v0_10: - node_version: 0.10 - steps: - - template: .azure-pipelines-steps.yml - - - job: Notify_Coveralls - displayName: Notify Coveralls that the parallel report is done - pool: - vmImage: "Ubuntu 16.04" - dependsOn: - - Test_Linux - - Test_Windows - - Test_MacOS - steps: - - script: curl -k https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN -d "payload[build_num]=$BUILD_NAME&payload[status]=done" - env: - COVERALLS_REPO_TOKEN: $(COVERALLS_REPO_TOKEN_SECRET) - BUILD_NAME: $(Build.BuildNumber) diff --git a/.github/support.yml b/.github/support.yml deleted file mode 100644 index 3ee3d22..0000000 --- a/.github/support.yml +++ /dev/null @@ -1,2 +0,0 @@ -# Configuration for support-requests - https://github.com/dessant/support-requests -_extends: gulp diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml new file mode 100644 index 0000000..3b07263 --- /dev/null +++ b/.github/workflows/dev.yml @@ -0,0 +1,75 @@ +name: dev +on: + pull_request: + push: + branches: + - master + - main +env: + CI: true + +jobs: + prettier: + name: Format code + runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Prettier + uses: gulpjs/prettier_action@v3.0 + with: + commit_message: 'chore: Run prettier' + prettier_options: '--write .' + + test: + name: Tests for Node ${{ matrix.node }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + node: [10, 12, 14, 16] + os: [ubuntu-latest, windows-latest, macos-latest] + + steps: + - name: Clone repository + uses: actions/checkout@v2 + + - name: Set Node.js version + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node }} + + - run: node --version + - run: npm --version + + - name: Install npm dependencies + run: npm install + + - name: Run lint + run: npm run lint + + - name: Run tests + run: npm test + + - name: Coveralls + uses: coverallsapp/github-action@v1.1.2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + flag-name: ${{matrix.os}}-node-${{ matrix.node }} + parallel: true + + coveralls: + needs: test + name: Finish up + + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@v1.1.2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + parallel-finished: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..8a10ce3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,17 @@ +name: release +on: + push: + branches: + - master + - main + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: GoogleCloudPlatform/release-please-action@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} + release-type: node + package-name: release-please-action + bump-minor-pre-major: true diff --git a/.gitignore b/.gitignore index 58a757a..aa0c563 100644 --- a/.gitignore +++ b/.gitignore @@ -20,7 +20,7 @@ coverage # nyc test coverage .nyc_output -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) .grunt # Bower dependency directory (https://bower.io/) diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..c96ebe0 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +coverage/ +.nyc_output/ +CHANGELOG.md diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index eda5b00..0000000 --- a/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -sudo: false -language: node_js -node_js: - - '12' - - '10' - - '8' - - '6' - - '4' - - '0.12' - - '0.10' -after_script: - - npm run coveralls diff --git a/LICENSE b/LICENSE index 84b3420..6ac3843 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2013 Blaine Bublitz , Eric Schoffstall and other contributors +Copyright (c) 2013, 2016-2022 Blaine Bublitz and Eric Schoffstall Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 40492a3..e63595c 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@

- +

# vinyl -[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Azure Pipelines Build Status][azure-pipelines-image]][azure-pipelines-url] [![Travis Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url] Virtual file format. @@ -421,6 +421,20 @@ Same goes for `clone()`. If you have your own internal stuff that needs special MIT + + +[downloads-image]: https://img.shields.io/npm/dm/vinyl.svg?style=flat-square +[npm-url]: https://www.npmjs.com/package/vinyl +[npm-image]: https://img.shields.io/npm/v/vinyl.svg?style=flat-square + +[ci-url]: https://github.com/gulpjs/vinyl/actions?query=workflow:dev +[ci-image]: https://img.shields.io/github/workflow/status/gulpjs/vinyl/dev?style=flat-square + +[coveralls-url]: https://coveralls.io/r/gulpjs/vinyl +[coveralls-image]: https://img.shields.io/coveralls/gulpjs/vinyl/master.svg?style=flat-square + + + [is-symbolic]: #issymbolic [is-directory]: #isdirectory [normalization]: #normalization-and-concatenation @@ -428,25 +442,8 @@ MIT [stream]: https://nodejs.org/api/stream.html#stream_stream [readable-stream]: https://nodejs.org/api/stream.html#stream_readable_streams [buffer]: https://nodejs.org/api/buffer.html#buffer_class_buffer -[fs-stats]: http://nodejs.org/api/fs.html#fs_class_fs_stats +[fs-stats]: https://nodejs.org/api/fs.html#fs_class_fs_stats [vinyl-fs]: https://github.com/gulpjs/vinyl-fs [cloneable-readable]: https://github.com/mcollina/cloneable-readable + -[downloads-image]: https://img.shields.io/npm/dm/vinyl.svg -[npm-url]: https://www.npmjs.com/package/vinyl -[npm-image]: https://img.shields.io/npm/v/vinyl.svg - -[azure-pipelines-url]: https://dev.azure.com/gulpjs/gulp/_build/latest?definitionId=$PROJECT_ID&branchName=master -[azure-pipelines-image]: https://dev.azure.com/gulpjs/gulp/_apis/build/status/vinyl?branchName=master - -[travis-url]: https://travis-ci.org/gulpjs/vinyl -[travis-image]: https://img.shields.io/travis/gulpjs/vinyl.svg?label=travis-ci - -[appveyor-url]: https://ci.appveyor.com/project/gulpjs/vinyl -[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/vinyl.svg?label=appveyor - -[coveralls-url]: https://coveralls.io/r/gulpjs/vinyl -[coveralls-image]: https://img.shields.io/coveralls/gulpjs/vinyl/master.svg - -[gitter-url]: https://gitter.im/gulpjs/gulp -[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 47b3ca2..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,32 +0,0 @@ -# http://www.appveyor.com/docs/appveyor-yml -# http://www.appveyor.com/docs/lang/nodejs-iojs - -environment: - matrix: - # node.js - - nodejs_version: "0.10" - - nodejs_version: "0.12" - - nodejs_version: "4" - - nodejs_version: "6" - - nodejs_version: "8" - - nodejs_version: "10" - - nodejs_version: "12" - -platform: - - x86 - - x64 - -install: - # https://www.appveyor.com/docs/lang/nodejs-iojs/#installing-any-version-of-nodejs-or-iojs - - ps: Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) $env:PLATFORM - - npm install - -test_script: - - node --version - - npm --version - - cmd: npm test - -build: off - -# build version format -version: "{build}" diff --git a/index.js b/index.js index 3a16e91..27c6b59 100644 --- a/index.js +++ b/index.js @@ -2,13 +2,12 @@ var path = require('path'); var util = require('util'); -var isBuffer = require('buffer').Buffer.isBuffer; +var Buffer = require('buffer').Buffer; var clone = require('clone'); var cloneable = require('cloneable-readable'); var replaceExt = require('replace-ext'); var cloneStats = require('clone-stats'); -var cloneBuffer = require('clone-buffer'); var removeTrailingSep = require('remove-trailing-separator'); var isStream = require('./lib/is-stream'); @@ -59,7 +58,7 @@ function File(file) { } File.prototype.isBuffer = function() { - return isBuffer(this.contents); + return Buffer.isBuffer(this.contents); }; File.prototype.isStream = function() { @@ -117,7 +116,7 @@ File.prototype.clone = function(opt) { if (this.isStream()) { contents = this.contents.clone(); } else if (this.isBuffer()) { - contents = opt.contents ? cloneBuffer(this.contents) : this.contents; + contents = opt.contents ? Buffer.from(this.contents) : this.contents; } var file = new this.constructor({ @@ -141,7 +140,8 @@ File.prototype.clone = function(opt) { return file; }; -File.prototype.inspect = function() { +// Node.js v6.6.0+ use this symbol for custom inspection. +File.prototype[util.inspect.custom] = function() { var inspect = []; // Use relative path if possible @@ -162,11 +162,6 @@ File.prototype.inspect = function() { return ''; }; -// Newer Node.js versions use this symbol for custom inspection. -if (util.inspect.custom) { - File.prototype[util.inspect.custom] = File.prototype.inspect; -} - File.isCustomProp = function(key) { return builtInFields.indexOf(key) === -1; }; @@ -182,7 +177,7 @@ Object.defineProperty(File.prototype, 'contents', { return this._contents; }, set: function(val) { - if (!isBuffer(val) && !isStream(val) && (val !== null)) { + if (!Buffer.isBuffer(val) && !isStream(val) && (val !== null)) { throw new Error('File.contents can only be a Buffer, a Stream, or null.'); } @@ -306,7 +301,12 @@ Object.defineProperty(File.prototype, 'extname', { Object.defineProperty(File.prototype, 'path', { get: function() { - return this.history[this.history.length - 1]; + var path = this.history[this.history.length - 1]; + if (path) { + return path; + } else { + return null; + } }, set: function(path) { if (typeof path !== 'string') { diff --git a/package.json b/package.json index 3d1dc9f..0c33a54 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "repository": "gulpjs/vinyl", "license": "MIT", "engines": { - "node": ">= 0.10" + "node": ">=10.13.0" }, "main": "index.js", "files": [ @@ -21,27 +21,32 @@ "scripts": { "lint": "eslint .", "pretest": "npm run lint", - "test": "nyc mocha --async-only", - "azure-pipelines": "nyc mocha --async-only --reporter xunit -O output=test.xunit", - "coveralls": "nyc report --reporter=text-lcov | coveralls" + "test": "nyc mocha --async-only" }, "dependencies": { "clone": "^2.1.1", - "clone-buffer": "^1.0.0", "clone-stats": "^1.0.0", - "cloneable-readable": "^1.0.0", + "cloneable-readable": "^2.1.0", "remove-trailing-separator": "^1.0.1", - "replace-ext": "^1.0.0" + "replace-ext": "^2.0.0" }, "devDependencies": { - "coveralls": "github:phated/node-coveralls#2.x", - "eslint": "^2.13.1", - "eslint-config-gulp": "^3.0.1", - "expect": "^1.20.2", - "mississippi": "^1.2.0", - "mocha": "^3.0.0", - "nyc": "^10.3.2", - "safer-buffer": "^2.1.2" + "eslint": "^7.32.0", + "eslint-config-gulp": "^5.0.1", + "eslint-plugin-node": "^11.1.0", + "expect": "^27.4.6", + "mississippi": "^4.0.0", + "mocha": "^8.4.0", + "nyc": "^15.1.0" + }, + "nyc": { + "reporter": [ + "lcov", + "text-summary" + ] + }, + "prettier": { + "singleQuote": true }, "keywords": [ "virtual", diff --git a/test/.eslintrc b/test/.eslintrc deleted file mode 100644 index 06b940f..0000000 --- a/test/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "gulp/test" -} diff --git a/test/file.js b/test/file.js index a71bb08..11fab2a 100644 --- a/test/file.js +++ b/test/file.js @@ -6,7 +6,6 @@ var util = require('util'); var expect = require('expect'); var miss = require('mississippi'); var cloneable = require('cloneable-readable'); -var saferBuffer = require('safer-buffer'); var File = require('../'); @@ -14,7 +13,6 @@ var pipe = miss.pipe; var from = miss.from; var concat = miss.concat; var isCloneable = cloneable.isCloneable; -var Buffer = saferBuffer.Buffer; var isWin = (process.platform === 'win32'); @@ -98,7 +96,7 @@ describe('File', function() { it('defaults path to null', function(done) { var file = new File(); - expect(file.path).toNotExist(); + expect(file.path).toBeFalsy(); expect(file.path).toEqual(null); done(); }); @@ -111,14 +109,14 @@ describe('File', function() { it('defaults stat to null', function(done) { var file = new File(); - expect(file.stat).toNotExist(); + expect(file.stat).toBeFalsy(); expect(file.stat).toEqual(null); done(); }); it('defaults contents to null', function(done) { var file = new File(); - expect(file.contents).toNotExist(); + expect(file.contents).toBeFalsy(); expect(file.contents).toEqual(null); done(); }); @@ -435,11 +433,11 @@ describe('File', function() { var file = new File(options); var file2 = file.clone(); - expect(file2).toNotBe(file); + expect(file2).not.toBe(file); expect(file2.cwd).toEqual(file.cwd); expect(file2.base).toEqual(file.base); expect(file2.path).toEqual(file.path); - expect(file2.contents).toNotBe(file.contents); + expect(file2.contents).not.toBe(file.contents); expect(file2.contents.toString('utf8')).toEqual(file.contents.toString('utf8')); done(); }); @@ -457,10 +455,10 @@ describe('File', function() { expect(copy1.contents).toBe(file.contents); var copy2 = file.clone(); - expect(copy2.contents).toNotBe(file.contents); + expect(copy2.contents).not.toBe(file.contents); var copy3 = file.clone({ contents: 'invalid' }); - expect(copy3.contents).toNotBe(file.contents); + expect(copy3.contents).not.toBe(file.contents); done(); }); @@ -474,11 +472,11 @@ describe('File', function() { var file = new File(options); var file2 = file.clone(); - expect(file2).toNotBe(file); + expect(file2).not.toBe(file); expect(file2.cwd).toEqual(file.cwd); expect(file2.base).toEqual(file.base); expect(file2.path).toEqual(file.path); - expect(file2.contents).toNotBe(file.contents); + expect(file2.contents).not.toBe(file.contents); var ends = 2; var data = null; @@ -491,7 +489,7 @@ describe('File', function() { } if (--ends === 0) { - expect(data).toNotBe(data2); + expect(data).not.toBe(data2); expect(data.toString('utf8')).toEqual(data2.toString('utf8')); done(); } @@ -596,7 +594,7 @@ describe('File', function() { var file = new File(options); var file2 = file.clone(); - expect(file2).toNotBe(file); + expect(file2).not.toBe(file); expect(file2.symlink).toEqual(file.symlink); done(); }); @@ -611,11 +609,11 @@ describe('File', function() { var file = new File(options); var file2 = file.clone(); - expect(file2).toNotBe(file); + expect(file2).not.toBe(file); expect(file2.cwd).toEqual(file.cwd); expect(file2.base).toEqual(file.base); expect(file2.path).toEqual(file.path); - expect(file2.contents).toNotExist(); + expect(file2.contents).toBeFalsy(); done(); }); @@ -633,8 +631,8 @@ describe('File', function() { expect(copy.stat.isFile()).toEqual(true); expect(copy.stat.isDirectory()).toEqual(false); - expect(file.stat).toBeAn(fs.Stats); - expect(copy.stat).toBeAn(fs.Stats); + expect(file.stat).toBeInstanceOf(fs.Stats); + expect(copy.stat).toBeInstanceOf(fs.Stats); done(); }); @@ -651,7 +649,7 @@ describe('File', function() { expect(copy.history[0]).toEqual(options.path); copy.path = 'lol'; - expect(file.path).toNotEqual(copy.path); + expect(file.path).not.toEqual(copy.path); done(); }); @@ -667,12 +665,12 @@ describe('File', function() { var file = new File(options); var file2 = file.clone(); - expect(file2).toNotBe(file); + expect(file2).not.toBe(file); expect(file2.cwd).toEqual(file.cwd); expect(file2.base).toEqual(file.base); expect(file2.path).toEqual(file.path); - expect(file2.custom).toNotBe(file.custom); - expect(file2.custom.meta).toNotBe(file.custom.meta); + expect(file2.custom).not.toBe(file.custom); + expect(file2.custom.meta).not.toBe(file.custom.meta); expect(file2.custom).toEqual(file.custom); done(); }); @@ -696,7 +694,7 @@ describe('File', function() { var file2 = file.clone(); expect(file2.history).toEqual(history); - expect(file2.history).toNotBe(file.history); + expect(file2.history).not.toBe(file.history); expect(file2.path).toEqual(history[2]); done(); }); @@ -714,21 +712,21 @@ describe('File', function() { var file2 = file.clone(); expect(file2.custom).toEqual(file.custom); - expect(file2.custom).toNotBe(file.custom); + expect(file2.custom).not.toBe(file.custom); expect(file2.custom.meta).toEqual(file.custom.meta); - expect(file2.custom.meta).toNotBe(file.custom.meta); + expect(file2.custom.meta).not.toBe(file.custom.meta); var file3 = file.clone(true); expect(file3.custom).toEqual(file.custom); - expect(file3.custom).toNotBe(file.custom); + expect(file3.custom).not.toBe(file.custom); expect(file3.custom.meta).toEqual(file.custom.meta); - expect(file3.custom.meta).toNotBe(file.custom.meta); + expect(file3.custom.meta).not.toBe(file.custom.meta); var file4 = file.clone({ deep: true }); expect(file4.custom).toEqual(file.custom); - expect(file4.custom).toNotBe(file.custom); + expect(file4.custom).not.toBe(file.custom); expect(file4.custom.meta).toEqual(file.custom.meta); - expect(file4.custom.meta).toNotBe(file.custom.meta); + expect(file4.custom.meta).not.toBe(file.custom.meta); var file5 = file.clone(false); expect(file5.custom).toEqual(file.custom); @@ -759,12 +757,12 @@ describe('File', function() { var file = new ExtendedFile(); var file2 = file.clone(); - expect(file2).toNotBe(file); + expect(file2).not.toBe(file); expect(file2.constructor).toBe(ExtendedFile); - expect(file2).toBeAn(ExtendedFile); - expect(file2).toBeA(File); - expect(ExtendedFile.prototype.isPrototypeOf(file2)).toEqual(true); - expect(File.prototype.isPrototypeOf(file2)).toEqual(true); + expect(file2).toBeInstanceOf(ExtendedFile); + expect(file2).toBeInstanceOf(File); + expect(Object.prototype.isPrototypeOf.call(ExtendedFile.prototype, file2)).toEqual(true); + expect(Object.prototype.isPrototypeOf.call(File.prototype, file2)).toEqual(true); done(); }); }); @@ -774,18 +772,14 @@ describe('File', function() { it('returns correct format when no contents and no path', function(done) { var file = new File(); var expectation = ''; - expect(file.inspect()).toEqual(expectation); expect(util.inspect(file)).toEqual(expectation); - if (util.inspect.custom) { - expect(file[util.inspect.custom]()).toEqual(expectation); - } done(); }); it('returns correct format when Buffer contents and no path', function(done) { var val = Buffer.from('test'); var file = new File({ contents: val }); - expect(file.inspect()).toEqual('>'); + expect(util.inspect(file)).toEqual('>'); done(); }); @@ -797,7 +791,7 @@ describe('File', function() { path: '/test/test.coffee', contents: val, }); - expect(file.inspect()).toEqual('>'); + expect(util.inspect(file)).toEqual('>'); done(); }); @@ -808,7 +802,7 @@ describe('File', function() { path: '/test/test.coffee', contents: from([]), }); - expect(file.inspect()).toEqual('>'); + expect(util.inspect(file)).toEqual('>'); done(); }); @@ -819,7 +813,7 @@ describe('File', function() { path: '/test/test.coffee', contents: null, }); - expect(file.inspect()).toEqual(''); + expect(util.inspect(file)).toEqual(''); done(); }); }); @@ -978,7 +972,7 @@ describe('File', function() { cwd: '/foo', base: '/bar', }); - expect(file.base).toNotEqual(file.cwd); + expect(file.base).not.toEqual(file.cwd); file.base = file.cwd; expect(file.base).toEqual(file.cwd); done(); @@ -989,11 +983,11 @@ describe('File', function() { cwd: '/foo', base: '/bar', }); - expect(file.base).toNotEqual(file.cwd); + expect(file.base).not.toEqual(file.cwd); file.base = null; expect(file.base).toEqual(file.cwd); file.base = '/bar/'; - expect(file.base).toNotEqual(file.cwd); + expect(file.base).not.toEqual(file.cwd); file.base = undefined; expect(file.base).toEqual(file.cwd); done(); @@ -1205,7 +1199,7 @@ describe('File', function() { var file = new File(); function invalid() { - var a = file.basename; + file.basename; } expect(invalid).toThrow('No path specified! Can not get basename.'); @@ -1518,7 +1512,7 @@ describe('File', function() { it('throws on set with null path', function(done) { var file = new File(); - expect(file.path).toNotExist(); + expect(file.path).toBeFalsy(); expect(file.history).toEqual([]); function invalid() {