Skip to content

Commit a095c27

Browse files
committed
updated dependencies & build tools
1 parent 2e0e070 commit a095c27

39 files changed

+5045
-3769
lines changed

Diff for: .gitignore

+3-38
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,6 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
6-
# Runtime data
7-
pids
8-
*.pid
9-
*.seed
10-
11-
# Directory for instrumented libs generated by jscoverage/JSCover
12-
lib-cov
13-
14-
# Coverage directory used by tools like istanbul
1+
.idea
2+
.DS_Store
153
coverage
16-
17-
# nyc test coverage
18-
.nyc_output
19-
20-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
21-
.grunt
22-
23-
# node-waf configuration
24-
.lock-wscript
25-
26-
# Compiled binary addons (http://nodejs.org/api/addons.html)
27-
build/Release
28-
29-
# Dependency directories
304
node_modules
31-
jspm_packages
32-
33-
# Optional npm cache directory
34-
.npm
35-
36-
# Optional REPL history
37-
.node_repl_history
38-
.idea
39-
DS_Store
405
lib
41-
/.coveralls.yml
6+
.coveralls.yml

Diff for: .npmignore

+5-42
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,8 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
6-
# Runtime data
7-
pids
8-
*.pid
9-
*.seed
10-
11-
# Directory for instrumented libs generated by jscoverage/JSCover
12-
lib-cov
13-
14-
# Coverage directory used by tools like istanbul
15-
coverage
16-
17-
# nyc test coverage
18-
.nyc_output
19-
20-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
21-
.grunt
22-
23-
# node-waf configuration
24-
.lock-wscript
25-
26-
# Compiled binary addons (http://nodejs.org/api/addons.html)
27-
build/Release
28-
29-
# Dependency directories
30-
node_modules
31-
jspm_packages
32-
33-
# Optional npm cache directory
34-
.npm
35-
36-
# Optional REPL history
37-
.node_repl_history
381
.idea
39-
DS_Store
2+
.DS_Store
403
jest
41-
test
42-
/.travis.yml
43-
/.coveralls.yml
44-
npm-shrinkwrap.json
4+
__tests__
455
src
6+
.travis.yml
7+
.coveralls.yml
8+
package-lock.json
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: test/unit/read.spec.ts renamed to __tests__/unit/read.spec.ts

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import * as fs from 'fs';
2-
import {read} from '../../src/index';
2+
import {read} from '../../src';
33

44
declare const require: (path: string) => any;
55

6-
function toArrayBuffer (buffer: Buffer) {
6+
function toArrayBuffer(buffer: Buffer) {
77
const length: number = buffer.length;
88
const ab: ArrayBuffer = new ArrayBuffer(length);
99
const view: Uint8Array = new Uint8Array(ab);
@@ -16,9 +16,13 @@ function toArrayBuffer (buffer: Buffer) {
1616
}
1717

1818
describe('#read', () => {
19-
function getTestData (mt940FileName: string, resultFileName: string, isBuffer: boolean): [Buffer|ArrayBuffer, any] {
20-
const buffer: Buffer = fs.readFileSync(`./test/cases/${ mt940FileName }`);
21-
const json: any[] = require(`./../cases/${ resultFileName }`);
19+
function getTestData(
20+
mt940FileName: string,
21+
resultFileName: string,
22+
isBuffer: boolean
23+
): [Buffer | ArrayBuffer, any] {
24+
const buffer: Buffer = fs.readFileSync(`./__tests__/cases/${mt940FileName}`);
25+
const json: any[] = require(`./../cases/${resultFileName}`);
2226

2327
return [isBuffer ? buffer : toArrayBuffer(buffer), json];
2428
}
@@ -31,8 +35,8 @@ describe('#read', () => {
3135
['BASE-2', 'base-2.mta', 'base-2.json'],
3236
['BASE-3', 'base-3.mta', 'base-3.json']
3337
].forEach(([provider, mt940FileName, resultFileName]) => {
34-
describe(`Provider: ${ provider }`, () => {
35-
function test ([data, expectedResult]: [Buffer|ArrayBuffer, any]) {
38+
describe(`Provider: ${provider}`, () => {
39+
function test([data, expectedResult]: [Buffer | ArrayBuffer, any]) {
3640
it('should parse the file content', () => {
3741
return read(data).then((statements) => {
3842
expect(statements).toEqual(expectedResult);
@@ -49,4 +53,4 @@ describe('#read', () => {
4953
});
5054
});
5155
});
52-
});
56+
});

Diff for: jest.config.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
coverageDirectory: '__tests__/coverage',
3+
coverageReporters: ['lcov', 'html'],
4+
collectCoverageFrom: ['src/*.{ts,tsx}', 'src/**/*.{ts,tsx}'],
5+
transform: {'.*': '<rootDir>/jest/preprocessor.js'},
6+
setupFilesAfterEnv: ['<rootDir>/jest/config.js'],
7+
testPathIgnorePatterns: ['/node_modules/', '/test/e2e/'],
8+
testRegex: '(/test/unit/.*|\\.(test|spec))\\.(ts|tsx|js)$',
9+
moduleFileExtensions: ['ts', 'tsx', 'js']
10+
};

0 commit comments

Comments
 (0)