<script> tags in templates for Tests script not working

Hi all,
I am trying to create a very simple Tests script, which can display response text. Here my <span> tag works fine, but I donā€™t get the console log in <script> tag. The console log outside the template works fine, also if I save the template contents as HTML, it prints the <script> tag console log. But it is not working with POSTMAN. Please help in the resolution.

My Tests script contents are as below.

var template = `

<script>console.log(ā€˜test in templateā€™);</script>

<span style=ā€œwhite-space: pre-lineā€>{{result}}</span>

`;

var jsonData = JSON.parse(responseBody);

result = jsonData.result

console.log(ā€˜test: in testā€™);

pm.visualizer.set(template, {

// Pass the response body parsed as JSON as `data`

result: result

});

Thanks,
prasanna