Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
690 views
in Technique[技术] by (71.8m points)

google apps script - Library with identifier QUnit is missing - G Suite for Education Account

I have been trying to use QUnit to test my code but have been getting this error: "Library with identifier QUnit is missing (perhaps it was deleted, or maybe you don't have read access?)."

I am sure I have installed it correctly with the correct key.

My google account is a G Suite for Education Account that's been set up by my company, I have two different Education accounts with them. Both accounts are in different organisational units from each other. One of them can run QUnit with no issues but I need it to work on the account that is throwing the error.

I took the following steps too add QUnit to my project:

  1. Went onto Libraries and entered the code "MxL38OxqIK-B73jyDTvCe-OBao7QLBR4j"

  2. Selected version 4.

  3. Published as a Web App and then selected "Test web app for your latest code" to view the results.

  4. I am then presented with the error message on a new tab.

When I try these same steps on my Personal Google Account as well there seems to be no issues.

Below is my QUnit code, if you can see where I've went wrong or if there are any G Suite Settings that should be changed that you know of that would be a great help.

function doGet( e ) {
  QUnit.urlParams( e.parameter );
  
  QUnit.config({
    title: "Unit tests for my project" 
  });
  QUnit.load( tests );
  return QUnit.getHtml();
};


function tests() {
  addEqual();
  addNotEqual();
  multiplyEqual();
  multiplyNotEqual();
}


function addEqual() {
  test("Add number to number", function() {
    equal(addNumbers(), 5, 'It worked!');
  });
}

function addNotEqual() {
  test("Add number to number", function() {
    equal(addNumbers(), 8, 'It worked!');
  });
}

function multiplyEqual() {
  test("Multiply Number with a Number", function() {
    equal(multiply(), 6, 'It Worked!');
  });
}

function multiplyNotEqual() {
  test("Multiply Number with a Number", function() {
    notEqual(multiply(), 9, 'It Worked!');
  });
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Summary:

So far, the easiest way to solve the issue is not to use the library feature at all, but directly copy paste files from the library's source. Note that all .gs and .html files should be included as separate files in your project. Other ways to solve includes various versions of deleting the calling script project and re-adding each library in a new project. On the library developer side, it includes saving a new version of the library.

Possible Cause(s):

Possible Solution(s):

Currently Open Issue Trackers:

Closed Trackers(for research):

Related:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...