File tree Expand file tree Collapse file tree 5 files changed +95
-0
lines changed
Expand file tree Collapse file tree 5 files changed +95
-0
lines changed Original file line number Diff line number Diff line change 1+ const host = Ti . Platform . osname === 'android' ? '10.0.2.2' : 'localhost' ;
2+ const port = '3210' ;
3+ module . exports . url = `http://${ host } :${ port } ` ;
Original file line number Diff line number Diff line change 1+ const testsContext = require . context ( './specs' , true , / \. s p e c \. j s $ / ) ;
2+
3+ testsContext . keys ( ) . forEach ( testsContext ) ;
Original file line number Diff line number Diff line change 1+ 'use strict' ;
2+
3+ module . exports = config => {
4+ config . set ( {
5+ basePath : '../..' ,
6+ frameworks : [ 'jasmine' ] ,
7+ files : [
8+ 'test/unit/specs/**/*spec.js'
9+ ] ,
10+ reporters : [ 'mocha' , 'junit' ] ,
11+ plugins : [
12+ 'karma-*'
13+ ] ,
14+ titanium : {
15+ sdkVersion : config . sdkVersion || '9.2.0.GA'
16+ } ,
17+ customLaunchers : {
18+ ios : {
19+ base : 'Titanium' ,
20+ browserName : 'iOS Emulator' ,
21+ displayName : 'ios' ,
22+ platform : 'ios'
23+ }
24+ } ,
25+ browsers : [ 'ios' ] ,
26+ client : {
27+ jasmine : {
28+ random : false
29+ }
30+ } ,
31+ singleRun : true ,
32+ retryLimit : 0 ,
33+ concurrency : 1 ,
34+ captureTimeout : 300000 ,
35+ logLevel : config . LOG_DEBUG
36+ } ) ;
37+ } ;
Original file line number Diff line number Diff line change 1+ {
2+ "extends": [ "axway/env-titanium", "plugin:jasmine/recommended"],
3+ "plugins": [ "jasmine" ],
4+ "env": {
5+ "node": true,
6+ "jasmine": true
7+ },
8+ "parserOptions": {
9+ "ecmaVersion": 2015,
10+ "sourceType": "script"
11+ },
12+ "globals": {
13+ "Ti": false,
14+ "Titanium": false,
15+ "__filename": false,
16+ "__dirname": false,
17+ "kroll": false
18+ }
19+ }
Original file line number Diff line number Diff line change 1+ const URLSession = require ( 'com.appcelerator.urlSession' ) ;
2+
3+ describe ( 'com.appcelerator.urlSession' , ( ) => {
4+ it ( 'can be required' , ( ) => {
5+ expect ( URLSession ) . toBeDefined ( ) ;
6+ } ) ;
7+
8+ it ( '.moduleId' , ( ) => {
9+ expect ( URLSession . moduleId ) . toBe ( 'com.appcelerator.urlSession' ) ;
10+ } ) ;
11+
12+ describe ( 'methods' , ( ) => {
13+ describe ( '#finishTasksAndInvalidate()' , ( ) => {
14+ it ( 'is a function' , ( ) => {
15+ expect ( URLSession . finishTasksAndInvalidate ) . toEqual ( jasmine . any ( Function ) ) ;
16+ } ) ;
17+ } ) ;
18+
19+ describe ( '#invalidateAndCancel()' , ( ) => {
20+ // eslint-disable-next-line jasmine/no-spec-dupes
21+ it ( 'is a function' , ( ) => {
22+ expect ( URLSession . invalidateAndCancel ) . toEqual ( jasmine . any ( Function ) ) ;
23+ } ) ;
24+ } ) ;
25+
26+ describe ( '#backgroundDownloadTaskWithURL()' , ( ) => {
27+ // eslint-disable-next-line jasmine/no-spec-dupes
28+ it ( 'is a function' , ( ) => {
29+ expect ( URLSession . backgroundDownloadTaskWithURL ) . toEqual ( jasmine . any ( Function ) ) ;
30+ } ) ;
31+ } ) ;
32+ } ) ;
33+ } ) ;
You can’t perform that action at this time.
0 commit comments