Skip to content

Commit e768c3b

Browse files
committed
change test to reflect output and change output target
1 parent f45f162 commit e768c3b

2 files changed

Lines changed: 8 additions & 18 deletions

File tree

‎test/array-buffer.ts‎

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,6 @@ import { PacketType } from '../src/packet-format';
22
import helpers from './helpers';
33

44
describe('parser', () => {
5-
it('encodes an ArrayBuffer', done => {
6-
const packet = {
7-
type: PacketType.EVENT,
8-
data: ['a', new ArrayBuffer(2)],
9-
id: 0,
10-
nsp: '/',
11-
};
12-
helpers(packet, done);
13-
});
14-
155
it('encodes a TypedArray', done => {
166
const array = new Uint8Array(5);
177
for (let i = 0; i < array.length; i++) {
@@ -27,15 +17,15 @@ describe('parser', () => {
2717
helpers(packet, done);
2818
});
2919

30-
it('encodes ArrayBuffers deep in JSON', done => {
20+
it('encodes TypedArray deep in JSON', done => {
3121
const packet = {
3222
type: PacketType.EVENT,
3323
data: [
3424
'a',
3525
{
3626
a: 'hi',
37-
b: { why: new ArrayBuffer(3) },
38-
c: { a: 'bye', b: { a: new ArrayBuffer(6) } },
27+
b: { why: new Uint8Array(35) },
28+
c: { a: 'bye', b: { a: new Uint8Array(6) } },
3929
},
4030
],
4131
id: 999,
@@ -48,7 +38,7 @@ describe('parser', () => {
4838
const packet = {
4939
type: PacketType.EVENT,
5040
data: ['a', {
51-
a: 'b', c: 4, e: { g: null }, h: new ArrayBuffer(9),
41+
a: 'b', c: 4, e: { g: null }, h: new Uint8Array(97),
5242
}],
5343
nsp: '/',
5444
id: 600,

‎tsconfig.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
1010
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
1111
/* Language and Environment */
12-
"target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
12+
"target": "ES2015", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
1313
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
1414
// "jsx": "preserve", /* Specify what JSX code is generated. */
1515
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
@@ -24,7 +24,7 @@
2424
/* Modules */
2525
"module": "ESNext", /* Specify what module code is generated. */
2626
"rootDir": "src", /* Specify the root folder within your source files. */
27-
"moduleResolution": "Node", /* Specify how TypeScript looks up a file from a given module specifier. */
27+
"moduleResolution": "Bundler", /* Specify how TypeScript looks up a file from a given module specifier. */
2828
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
2929
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
3030
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
@@ -42,7 +42,7 @@
4242
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
4343
"declarationMap": true, /* Create sourcemaps for d.ts files. */
4444
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
45-
"sourceMap": true, /* Create source map files for emitted JavaScript files. */
45+
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
4646
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
4747
"outDir": "dist", /* Specify an output folder for all emitted files. */
4848
"removeComments": true, /* Disable emitting comments. */
@@ -52,7 +52,7 @@
5252
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
5353
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
5454
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
55-
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
55+
"inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
5656
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
5757
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
5858
// "newLine": "crlf", /* Set the newline character for emitting files. */

0 commit comments

Comments
 (0)