File tree Expand file tree Collapse file tree 7 files changed +31
-23
lines changed Expand file tree Collapse file tree 7 files changed +31
-23
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,6 @@ dist: trusty
44before_script :
55 - npm install
66 - ' export PATH=$PWD/node_modules/.bin:$PATH'
7- node_js : 6
7+ node_js : node
88script :
99 - xvfb-run npm run test
Original file line number Diff line number Diff line change 1+ import glob from 'glob' ;
2+ import Jasmine from 'jasmine' ;
3+
4+ const jasmine = new Jasmine ( ) ;
5+
6+ const pattern = process . argv [ 2 ] || 'test/spec/*.js' ;
7+
8+ // Load your specs
9+ glob ( pattern , function ( er , files ) {
10+ Promise . all (
11+ files
12+ // Use relative paths
13+ . map ( f => f . replace ( / ^ ( [ ^ \/ ] ) / , './$1' ) )
14+ . map ( f => import ( f )
15+ . catch ( e => {
16+ console . error ( '** Error loading ' + f + ': ' ) ;
17+ console . error ( e ) ;
18+ process . exit ( 1 ) ;
19+ } ) )
20+ )
21+ . then ( ( ) => jasmine . execute ( ) ) ;
22+ } ) ;
Original file line number Diff line number Diff line change 33 "version" : " 2.0.0" ,
44 "description" : " JSON Patch Operational Transformations - resolves outdated JSON Patches (RFC6902) in real-time JSON collaboration" ,
55 "main" : " src/json-patch-ot.js" ,
6+ "type" : " module" ,
67 "typings" : " index.d.ts" ,
78 "scripts" : {
8- "test" : " jasmine test/spec/transformSpec.js"
9+ "test" : " node --experimental-modules jasmine-run.js test/spec/transformSpec.js"
910 },
1011 "repository" : {
1112 "type" : " git" ,
2526 "url" : " https://github.com/Palindrom/JSON-Patch-OT/issues"
2627 },
2728 "homepage" : " https://github.com/Palindrom/JSON-Patch-OT" ,
28- "engines" : {
29- "node" : " >= 0.4.0"
30- },
3129 "devDependencies" : {
3230 "grunt" : " ^1.0.4" ,
3331 "grunt-bump" : " ^0.8.0" ,
Original file line number Diff line number Diff line change @@ -149,8 +149,5 @@ var JSONPatchOT = (function(){
149149 return JSONPatchOT ;
150150} ( ) ) ;
151151
152- if ( typeof module !== 'undefined' ) {
153- module . exports = JSONPatchOT ;
154- module . exports . default = JSONPatchOT ;
155- module . exports . __esModule = true ;
156- }
152+ export default JSONPatchOT ;
153+ export { JSONPatchOT } ;
Original file line number Diff line number Diff line change 1111 < script src ="../node_modules/jasmine-core/lib/jasmine-core/jasmine-html.js "> </ script >
1212 < script src ="../node_modules/jasmine-core/lib/jasmine-core/boot.js "> </ script >
1313
14- <!-- include source files here... -->
15- < script src ="../src/json-patch-ot.js "> </ script >
16-
1714 <!-- include spec files here... -->
18- < script src ="spec/transformSpec.js "> </ script >
19-
15+ < script type ="module " src ="spec/transformSpec.js "> </ script >
2016
2117</ head >
2218
Original file line number Diff line number Diff line change 1111 < script src ="../node_modules/jasmine-core/lib/jasmine-core/jasmine-html.js "> </ script >
1212 < script src ="../node_modules/jasmine-core/lib/jasmine-core/boot.js "> </ script >
1313
14- <!-- include source files here... -->
15- < script src ="../dist/json-patch-ot.min.js "> </ script >
16-
1714 <!-- include spec files here... -->
18- < script src ="spec/transformSpec.js "> </ script >
19-
15+ < script type ="module " src ="spec/transformSpec.js "> </ script >
2016
2117</ head >
2218
Original file line number Diff line number Diff line change 11var obj ;
22
3- if ( typeof JSONPatchOT === 'undefined' ) {
4- JSONPatchOT = require ( '../../src/json-patch-ot' ) ;
5- }
3+ import { JSONPatchOT } from '../../src/json-patch-ot.js' ;
4+
65describe ( "JSONPatchOT when `.transform`s" , function ( ) {
76
87 describe ( "given JSON Patch sequence, and" , function ( ) {
You can’t perform that action at this time.
0 commit comments