tal icon indicating copy to clipboard operation
tal copied to clipboard

How to get getCurrentApplication in jasmine amd

Open Arunprasanth opened this issue 6 years ago • 0 comments

I have created a specRunner.html for executing jasmine based unit test for bbctal, but unfortunalty I coundnt get CurrentApplication in the test pointing file .

Below is my specRunner.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="shortcut icon" type="image/png" href="js/lib/jasmine-1.1.0.rc1/jasmine_favicon.png">
	<link rel="stylesheet" type="text/css" href="js/lib/jasmine-1.1.0.rc1/jasmine.css">
	<script type="text/javascript" src="js/lib/jasmine-1.1.0.rc1/jasmine.js"></script>
	<script type="text/javascript" src="js/lib/jasmine-1.1.0.rc1/jasmine-html.js"></script>

	<script type="text/javascript" src="js/lib/require.js"></script>

    <title>Jasmine Spec Runner</title>

            <script type="text/javascript">
              require.config({
                    paths: {
                        "antie": "../../../node_modules/tal/static/script",
                        'code':'../../script/appui/components',
                        'application':'../../script',
                        'vendor':'../../script/vendor'
                       
                    }
                }) 
                require([
			//include all specs to be run
			'../tests/spec/sampleSpec'
		],
			function() {
              
				//run tests
				jasmine.getEnv().addReporter(new jasmine.TrivialReporter());
				jasmine.getEnv().execute();
			});
               


            </script>

</head>

<body></body>

</html> 

my sampleSpec.js

define(["code/signin"], function(signin) {
    console.log(new sign())

      });
      
 
My signin component contain code like below 

var _device = RuntimeContext.getDevice();

var _sessionStorage = _device.getStorage(StorageProvider.STORAGE_TYPE_SESSION, "application");

Arunprasanth avatar Mar 21 '18 08:03 Arunprasanth