bbc / tal

TV Application Layer
http://bbc.github.com/tal
Other
560 stars 149 forks source link

How to get getCurrentApplication in jasmine amd #492

Closed Arunprasanth closed 1 year ago

Arunprasanth commented 6 years ago

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");
kukulaka commented 1 year ago

I apologise that no one got back to you on this issue.

We have deprecated this project and there are no plans for active development going forward.

Please see the deprecation notice.