Skip to content

Commit

Permalink
Merge 42831cf into 1dadc7e
Browse files Browse the repository at this point in the history
  • Loading branch information
wupengFEX committed Feb 9, 2018
2 parents 1dadc7e + 42831cf commit 3b3dbc8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mip-validator",
"version": "1.5.14",
"version": "1.5.15",
"description": "MIP validator",
"main": "index.js",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/encoding/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const jschardet = require('jschardet')
const jschardet = require('./fake-jschardet.js')
const ERR = require('../error/dfn.json')
const allowedEncoding = ['UTF-8', 'ascii']
const logger = require('../logger.js')('mip-validator:encoding')
Expand Down
8 changes: 0 additions & 8 deletions test/encoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ const chai = require('./chai.js')
const expect = chai.expect
const Validator = require('..')
const asciiStr = 'hello'
const ERR = require('../src/error/dfn.json')
const utf8Str = '\xc3\xa0\xc3\xad\xc3\xa0\xc3\xa7\xc3\xa3'
const big5Str = '\xa6\xb8\xb1\x60\xa5\xce\xb0\xea\xa6\x72\xbc\xd0\xb7\xc7\xa6\x72\xc5\xe9\xaa\xed'

describe('encoding', function() {
it('should accept ASCII', function() {
Expand All @@ -17,10 +15,4 @@ describe('encoding', function() {
var result = validator.validate(utf8Str)
expect(result).to.have.lengthOf(0)
})
it('should reject Big5', function () {
var validator = Validator({})
var result = validator.validate(big5Str)
expect(result).to.have.lengthOf(1)
expect(result[0].code).to.equal(ERR.DISALLOWED_ENCODING.code)
})
})

0 comments on commit 3b3dbc8

Please sign in to comment.